Microsoft.Fakes won't run in normal unit test contexts

前端 未结 3 398
囚心锁ツ
囚心锁ツ 2020-12-30 23:50

I\'m using a simple proof-of-concept Fakes nUnit test:

  [Test]
  public void TestFakes()
  {
      using (var ctx = ShimsContext.Create())
      {
                  


        
3条回答
  •  隐瞒了意图╮
    2020-12-31 00:41

    I believe your answer is to use one of following commands:

    VSTest.Console.exe UnitTests.dll /UseVsixExtensions
    
    VSTest.Console.exe UnitTests.dll /TestAdapterPath:%LocalAppData%\Microsoft\VisualStudio\12.0\Extensions\
    

    These commands will run fine on dev machines. In case you want to run unit tests on build server, copy nunit test adapter folder to build server and mention that path.

提交回复
热议问题