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
The 4th (final) line below throws an exception:
IRepository<PocoType> fakedRepository = Isolate.Fake.Instance<IRepository<PocoType>>();
TargetType fakedTarget = Isolate.Fake.Instance<TargetType>();
PocoType fakedPoco = Isolate.Fake.Instance<PocoType>();

Isolate.WhenCalled<PocoType>( ( poco ) => fakedRepository.Insert( poco ) )
    .AndArgumentsMatch( poco => ( poco == fakedPoco ) ).WillReturn( fakedPoco );



The exception thrown:

Test method UnitTest.TestDataPortal_Insert 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..



I intend to mock whenever an insert is called on the irepository<PocoType> interface; Instead I get the error above.

    public interface IRepository<PocoType>: IDisposable
    {
        /// .
        /// .
        /// .

        /// <summary>
        /// Calls a insert function for a particular object.
        /// </summary>
        /// <param></param>
        /// <returns></returns>
         PocoType Insert(object entity);

        /// .
        /// .
        /// .
     }
}

asked by trp (4.1k points)

3 Answers

0 votes
Hi trp,

Is this issue still relevant following the patched version I've sent you? The issue you describe is specific to a patch we released which had an obfuscation issue. The latest patch I've sent you should resolve this issue.

Doron
Typemock Support
answered by doron (17.2k points)
0 votes
Yes, I am still getting the exception.
answered by trp (4.1k points)
0 votes
I suggest setting up an online session to see how we can help with this and other issues you reported. I will contact you offline to set that up.
Doron
Typemock Support
answered by doron (17.2k points)
...