Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Typemock test runner issue: For test setup that reload app domain for every test

0 votes
Hi,

Sorry that my company policy doesn't allow me to post any code block in this questions so I have to try explaining the problem by words.

I'm trying to create unit test for a legacy classes that contains 50 static variables.

As you could imagine that the static variables are dirty after being tested and i came up with a solution for creating new appdomain for every test. That involved "AppDomain.CreateDomain" and "domain.CreateInstanceFromAndUnwrap"

Those test works perfectly on Resharper test runner and nunit test runner

But the Typemock test running all return failed with exception

System.IO.FileNotFoundException : Could not load file or assembly 'TypeMock, Version=8.2.3.20, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' or one of its dependencies. The system cannot find the file specified.

Again, sorry that I cannot post any code block over here. So, please let me know if anything is not clear about my problem.

 

Thanks
asked Feb 2, 2016 by cscmh99 (340 points)

1 Answer

0 votes

Hi,

To analyze the FileNotFoundException  please use fusion log:

https://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

 

Or, you can reinitialize the class setup by manually calling static constructors with : Isolate.Invoke.StaticConstructor(typeof(<type>));

in the begining of every test (or TestInitialize).

Let me know if it helped.

 

Alex Galin | Support Team

answered Feb 2, 2016 by alex (17,910 points)
...