2833 shaares
5 private links
5 private links
You can easily write unit tests by simply mocking the DbContext methods. For example you could mock the Entities property to always return a fake list of objects. That way the DbContext won’t make any external calls to your data layer.
How do you do that?