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
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.
asked by trp (4.1k points)

5 Answers

0 votes
Hi,

The TypeLoadException you received initially happened for a specific patched version we sent you a while ago. We sent over a new patched version a day or two after that - can you confirm you are using the more recent version? Anyway, I'm sending your email our 5.3.1 release candidate that definitely resolves this issue.

Doron
Typemock Support
answered by doron (17.2k points)
0 votes
I upgraded to 5.3.1 and after removing all references to TypeMock and adding references to TypeMock 5.3.1 in my application it works! Thank you very much!

-Tom
answered by trp (4.1k points)
0 votes
I upgraded to 5.3.1 and I would like to see TypeMock working but I can't because my code won't compile. I don't know where the MethodCallContext class is as well as several others:

MethodCallContext
TMDuringCallEventArgs
TMShouldInterceptEventArgs
EventTunnel

I have already discussed with Gil why we are using these classes so please don't tell me that I shouldn't be using them instead help me compile my application. I can refactor and take them out later if necessary.

-Tom
answered by trp (4.1k points)
0 votes
Tom,

I'll look into this; the event tunnel should definitely be in the version you have.

Doron
Typemock Support
answered by doron (17.2k points)
0 votes
This is fixed in 5.3.1 that Gil sent me. Thank you.
answered by trp (4.1k points)
...