I wonder if there is anyway one can fake up a generic method call, for all possible types (or specified sub-types)?
For example, suppose we have this wonderful IBar interface.
public interface IBar
{
int Foo<T>();
}
Can I fake a dependency to this IBar's Foo call, without having to specify T being any specific type?
[TestFixture]
public class BarTests
{
[Test]
public void BarFooDoesStuff()
{
var expected = 9999999;
var fakeBar = A.Fake<IBar>();
A.CallTo(() => fakeBar.Foo<T>()).Returns(expected);
var response = fakeBar.Foo<bool>();
Assert.AreEqual(expected, response);
}
}
Thanks!