How to replace Moq with FakeItEasy in .NET unit tests
When working with unit tests in .NET, you might find yourself using the Moq framework to create mock objects. However, there are alternative frameworks like FakeItEasy that offer similar functionalities using a different approach. In this article, we’ll explore how to replace Moq with FakeItEasy, focusing on the following changes:
- Instantiating a New Mock
- Setting up / Mocking the response of a method
- Setting up properties
- Passing the Mock as a parameter to a class
- Replacing the Protected method of Moq
- Verifying method calls