I don't usually do this, but sometimes, under the rarest condition when I need to test my unit test code, to see whether the unit test logic is correct ( I know, I know, it's kind of recursive problem: do we need to unit test the unit test code, or do we need to unit test the unit test the unit test code, and so on), it seems that Typemock doesn't handle Mocking NUnit.Framework.Assert.AreEqual very well.
Here's the code
Isolate.WhenCalled(() => Assert.AreEqual(1,2)).IgnoreCall();
And it will generate this exception:
failed: TypeMock.TypeMockException :
*** Cannot mock methods defined in types from mscorlib assembly.
C:developmentE7 .Net2Integration Test SolutionE7IntegTestE7IntegTestListernerTest.cs(64,0): at Esteem.Tests.E7IntegTest.ListernerTest.<WhyOpen2Case>b__0()
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
C:developmentE7 .Net2Integration Test SolutionE7IntegTestE7IntegTestListernerTest.cs(0,0): at Esteem.Tests.E7IntegTest.ListernerTest.WhyOpen2Case()
But as you can see, Assert is not a method in mscorlib; it's a method in NUnit.Framework.dll
________
TOYS COUPLE