Creating Mock Objects for C# Unit Tests, using Moq
Contents
Creating Mock Objects for C# Unit Tests, using Moq
https://scottlilly.com/creating-mock-objects-for-c-unit-tests-using-moq/
In my demonstration of the Dependency Injection design pattern, I manually created a mock object. This let me perform unit tests without needing to access a database.
Here is how you can use the Moq library, to eliminate writing the code for manual mock classes.
If you aren’t familiar with dependency injection, please read this article first
Source: commit d0b85b7 in My-Notes.