chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
+1 vote

I trying the run the test cases in VS cmd 2017 MSTest.exe /testcontainer:unitest.dll /resultsfile:C:\\\\result.txt.

However, when running the above command, it records a bunch of failures into my result.txt file, all of which says,

Test Run deployment issue: The assembly or module \\\'dll\\\' directly or indirectly referenced by the test container along with the below error message,


          <Message>Test method dll threw exception:


*** Typemock Isolator is currently disabled. Enable using the following:

 * Within Visual Studio:

   - Use Typemock Smart Runner  

   - For other runners, Choose Typemock Menu and click \\\"Integrate with Other Runners\\\"


 * To run Typemock Isolator as part of an automated process you can:

    - run tests via TMockRunner.exe command line tool

    - use \\\'TypeMockStart\\\' tasks for MSBuild or NAnt


For more information consult the documentation (see \\\'Running Unit Tests in an Automated Build\\\')</Message>

          <StackTrace>    at TypeMock.InterceptorsWrapper.VerifyInterceptorsIsLoaded()

   at _bA8MUQpKrWjP9CfB6RrB0Z34ehO_._6FuHQwNCuPHBRvIV7SHnpnSiqvL_._2cFKNkGqghvNa04ua7KbBkckuQB_()

   at TypeMock.MockManager.Init(Boolean collectAllCalls)

   at _FOxS0GrAvpjtZgiarLWDABZzuqv_._BFmGFkAxbdbd4exl0lSy0uwFqwl_._xRL0uEmGxgt8coXPq5Ty9sfsevB_[\\\\u0001](Members , Constructor , Constructor , Type , Object[] )

   at _FOxS0GrAvpjtZgiarLWDABZzuqv_._BFmGFkAxbdbd4exl0lSy0uwFqwl_.Instance[T](Members behavior)

   at _FOxS0GrAvpjtZgiarLWDABZzuqv_._BFmGFkAxbdbd4exl0lSy0uwFqwl_.Instance[T]()



Requesting to please help me on this.
asked by salman_khan (610 points)

1 Answer

0 votes
Hi Salman,

If you wish to run tests via cmd, the recommended way is using TMockRunner.

Can you try running your tests with TMockRunner and let me know if it works?


answered by SapirTypemock (3.2k points)

Started cmd and ran the below command

C:\\Program Files (x86)\\Typemock\\Isolator\\8.6\\BuildScripts>TMockRunner.exe mstest.exe unit-test.dll

Typemock Isolator Enterprise License - License will expire in 12 day(s)


Error running: mstest.exe The system cannot find the file specified
Okay, here is what I did. Opened Developer Command Prompt VS2017 and ran the following command C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional>\"C:\\Program Files (x86)\\Typemock\\Isolator\\8.6\\BuildScripts\\TMockRunner.exe\" MSTest.exe /testcontainer:unit-test.dll /resultsfile:C:\\testResult.txt

This worked and made all my test cases to pass.

Thanks Sapir, for giving me the pointer.
Hi Salman,

I\'m glad to hear that you managed to solve the issue!

Please let us know if we can assist you in any other way.