What steps will reproduce the problem?
1. Try to define a mock for an interface that has a generic method. E.g.:
public interface IFoo
{
T Bar<T>();
}
var mock = new Mock<IFoo>();
mock.Setup(foo => foo.Bar<It.IsAnyType>()).Returns(default(anyType));
What is the expected output? What do you see instead?
The last line is invalid syntax. I would expect that there is a way to mock
generic methods such that I can get the type that was used in the call and do
something with it. I do NOT want to mock each possible type one by one.
What version of the product are you using? On what operating system?
.NET 4
Windows 7
Please provide any additional information below.
Original issue reported on code.google.com by gkn0...@gmail.com on 1 Mar 2013 at 11:33
Original issue reported on code.google.com by
gkn0...@gmail.com
on 1 Mar 2013 at 11:33