I'm running Isolator 188.8.131.52 on Windows Server 2008 Enterprise, using VS 2008. My tests have this class initializer:
public static void ClassInitialize(TestContext context)
// This method can only be called once.
I do a full rebuild of my solution. When I run the tests under VS (menu item Test, Run, All Tests in Solution), all but one of the tests fail with the error:
Class Initialization method [...].ClassInitialize threw exception. TypeMock.TypeMockException: TypeMock.TypeMockException:
*** Static constructor for class SPUtility cannot be faked as it has already been called.
But when I run the tests from the command line -- or, more precisely, when I run MSBuild and build my projects "UnitTest" target, which runs this command:
$(TypeMockPath)\TMockRunner.exe -logpath $(TypeMockLogPath) MSTest.exe /testcontainer:$(inetroot)\private\Test\UnitTest\bin\$(Configuration)\MyProject.UnitTest.dll
... then the tests pass. This is repeatable.
Thanks for any help,