Hi,
I'm having some trouble getting mocking of generic types to work. I get a System.Reflection.TargetException with the following code:
class Test
{
public List<T> GetList<T>()
{
return new List<T>();
}
}
[Test]
[VerifyMocks]
public void GenericTest()
{
List<int> myList = new List<int>();
Test test = new Test();
using (RecordExpectations recorder = mocker.Record())
{
recorder.ExpectAndReturn(test.GetList<int>(), myList);
}
Assert.AreSame(myList, test.GetList<int>());
}
This should work, shouldn't it?
Cheers,
Rory.
________
marijuana indica