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);
/// .
/// .
/// .
}
}