2012-06-13 153 views
17

我們有開發人員使用Visual Studio 2010專業版,有些人嘗試使用Visual Studio 2012.兩個版本之間的項目兼容性一直不錯。Microsoft Fakes可以用於Visual Studio 2010嗎?

如果我們爲單元測試引入新的Fakes Framework,Visual Studio項目是否仍與2010兼容?

+0

我的假設是,如果所有依賴引用都包含在項目中,它將在2010年下工作,但2010年將沒有任何需要VS 2012 Premium或更高版本的Fakes Framework的UI或Intellisense。 –

+0

根據http://www.microsoft.com/visualstudio/eng/products/compare的說法,虛擬物品甚至需要VS.Net 2012旗艦版 –

回答

10

當前Microsoft Fakes在VS 2010中不起作用。但是,項目會編譯使用Fakes的測試,並在下面的堆棧跟蹤中引發NotSupportedException。

at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InvokeEvent(T value, Action`1 eh) 
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.OnAttachedUnsupportedMethod(MethodBase method) 
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.CheckInstrumentation(MethodBase method) 
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InternalAttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate) 
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.AttachDetour(Object optionalReceiver, MethodBase method, Delegate detourDelegate) 

我會建議使用痣,這是微軟假貨的以前版本。關於從痣移動到假貨,這裏有很棒的article

+1

By not does not work,do you mean,「project will not compile」or do you mean工具和測試只是不可用? –

+1

我加了解釋。 – k0stya

相關問題