Tag: 微软假货

UnitTestIsolationException:在Release / Debug模式下运行Shims测试时抛出exception

我试图使用Microsoft Shims.Context.Create();运行此unit testing,但它在Shims.Context.Create();抛出exceptionShims.Context.Create(); 方法。 环境: VS 2012,Win2K8 R2 namespace MyShimsUnitTest { [TestClass] public class MyUnitTest { [TestMethod] public void GetCurrentYear() { using (Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create()) { // Some Logic… } } } } 详细例外: Result Message: Test method MyShimsUnitTest.MyUnitTest.GetCurrentYear threw exception: Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test Result StackTrace: […]