If it\'s harder to explain using words, let\'s look at an example I have a generic function like this
void FunctionA() where T : Form, new()
{
}
I solved this problem in a different way. I have a list class that encapsulates the (real) Dapper functionality. It inherits from a base class that is the dummy class for mocking. Every method in the base class is overridden by the real class. Then I don't need to do anything special. If in the future, I want to do something special with SQLite or a home-grown in-memory database, I can always add that to the base class later if I wish.