DbConnection without Db using in-memory DataSet (or similar) as source
问题 I'm trying to unit test a few .NET classes that (for good design reasons) require DbConnections to do their work. For these tests, I have certain data in memory to give as input to these classes. That in-memory data could be easily expressed as a DataTable (or a DataSet that contains that DataTable), but if another class were more appropriate I could use it. If I were somehow magically able to get a DbConnection that represented a connection to the in-memory data, then I could construct my