3 ms·
That's much more complicated than just mocking your context in unit tests.... https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113).aspx https://msdn.mic
by scarface74 10y ago
That's much more complicated than just mocking your context in unit tests....
https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113).aspx https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113)....
Go down to "Testing Query Scenerios". I've wrapped the four "mockset.As" lines into one extension method to make it a lot less verbose.
- jamra 10y agoYes it is, but it's much less complicated than trying to guess what your generated SQL code will look like.
- scarface74 10y agoNo need to guess. Run all of your unit tests without mocking out your DbContext and add the following .... context.Database.Log = log.Info Where Log.info is just a method that accepts a string and take a look at the log file generated from your unit tests.