I want to test a function with the type signature
public static void DoSomething<T>(T something)
where T : class, IInterfaceA, IInterfaceB, new()
which uses new T()
internally.
I'm having problems creating a mock for T
. Thanks to another question, I already found a solution for mocking multiple interfaces. However, I'm unable to create a mock satisfying the new()
constraint. How do I solve this using Moq?