I have an interface
public interface IDataProvider
{
T GetDataDocument<T>(Guid document) where T:class, new()
}
I'd like to mock it in a way, that it would just return a new instance of a given type, regardless of the exact type, something like:
myMock.Setup(m => m.GetDataDocument<It.IsAny<Type>()>(It.IsAny<Guid>()))
.Returns(() => new T());
(which doesn't work of course, because I cannot just give any type parameter to moq, and I can't know which type must be returned.
Any ideas on this one?