I'm not sure if this bug should be address to your team, but I'll take a risk and try to ask it since I use typemock.net in all my tests.
I've got AccessViolationException in one of my tests when I run all tests in assembly. BUT IT'S SUCCEDED in either of the following:
1) I run this test along
2) I rename test class name (test fixture class name, not the tested class) so it changes the position is test order
3) I add new dummy test class (one emtpy test method) with the name like the failed one + suffux , but so the dummy one is placed before the test fixture.
4) I remove any of other test fixture before this one.
In any of this options the test succeeded.
Error occurs in the following real applicatrion class method, line
retInstance.Initialize()
public static Service Get<Service>() where Service : IService, new()
{
Service retInstance = (Service) instances[typeof(Service)];
if (retInstance == null)
{
lock (syncRoot)
{
retInstance = (Service) instances[typeof(Service)];
if (retInstance == null)
{
retInstance = new Service();
retInstance.Initialize();
instances[typeof(Service)] = retInstance;
}
}
}
return retInstance;
}
Have no idea, why. Do you? What would you suggest to check?