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
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 by cscmh99 (6.1k 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.

answered by alex (17k points)
...