Hello,
I experience an issue with Isolate.WhenCalled. Suppose I have, in assembly A, a class that does:
public class MyCollection<T> : IList<T>
{
public virtual void Add(T item) { .. }
.
.
}
Assembly B references assembly A, and defines:
public class NewCollection : MyCollection<NewObj>
{
}
Notice it does not override Add. When I do in a test:
[Test]
public void TestColl()
{
var coll = Isolate.Fake.Instance<NewCollection>();
Isolate.WhenCalled(() => coll.Add(null)).CallOriginal();
}
This throws an exception. I don't have the stack trace handy, but it was looking for a reference to the method in a generic dictionary, and it couldn't find it. However, if in NewCollection i override the Add method (and simply return the base implementation), then this works fine.
Why is that?
Thanks.