I am describing the behavior I am seeing. Typemock used to work great then I upgraded. Gil still hasn't e-mailed me back on these issues but I will add them here.
The code below sends the following exception
[TestMethod]
public void StupidTest()
{
TypeMock.ArrangeActAssert.Isolate.WhenCalled( MockKids ).IgnoreCall();
HiKids();
TypeMock.ArrangeActAssert.Isolate.Verify.WasCalledWithAnyArguments( MockKids );
}
public void HiKids()
{
MockKids();
}
public void MockKids() { }
Test method McKesson.ECSG.UT.BO.Shared.AO.ReferralNameAOTest.StupidTest threw exception: System.TypeLoadException: Method 'ReturnRecursiveFake' in type 'TypeMock.ArrangeActAssert.Recorder`1' from assembly 'Typemock.ArrangeActAssert, Version=5.3.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' does not have an implementation..
So I refactored it:
[TestMethod]
public void StupidTest()
{
TypeMock.ArrangeActAssert.Isolate.NonPublic.WhenCalled( this, "MockKids" ).IgnoreCall();
HiKids();
TypeMock.ArrangeActAssert.Isolate.Verify.NonPublic.WasCalled( this, "MockKids" );
}
public void HiKids()
{
MockKids();
}
public void MockKids() { }
}
And now when I comment out the line that calls MockKids in the HiKids method the following exception was thrown as expected:
Test method McKesson.ECSG.UT.BO.Shared.AO.ReferralNameAOTest.StupidTest threw exception: TypeMock.VerifyException:
TypeMock Verification: Method McKesson.ECSG.UT.BO.Shared.AO.ReferralNameAOTest.MockKids() was expected but was not called.
So my question is why does it work when I use the AAA format and treat everything as non public but typemock doesn't work when I use the AAA format the traditional way?
Thanks.