> For the complete documentation index, see [llms.txt](https://dotnetweb30-ke.gitbook.io/ke/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dotnetweb30-ke.gitbook.io/ke/verification/automated-testing-frameworks-tools-libraries/.net-mocking-frameworks-a-comparison.md).

# .NET Mocking Frameworks, a comparison

### What is a Mocking Framework?

Mocking framework is used to create replacement objects like Fakes, Stubs and Mocks. It is used to isolate each dependency and help developers in performing unit testing in a concise, quick and reliable way.

Creating mock objects manually is difficult and time consuming so to increase your productivity you can go for automatic generating of mock objects by using a mocking framework. A developer can build his/her unit test by using any of one NUnit, MbUnit, MSTest, xUnit etc. unit test framework and can further test it on a mocking framework.

### Here Comes Our List of Top 3 Mocking Frameworks for .Net Developers:

**1) NSubstitute**

NSubstitute is a free and open source mocking framework. NSubstitute creates friendly substitute for .Net mocking libraries. It is designed for Arrange-Act-Assert (AAA) testing.\
**Source Code:** <https://github.com/nsubstitute/NSubstitute/>\
**Testing Type:** Arrange-Act-Assert (AAA)

**2) Moq**

This is a popular mocking framework for .Net. This mocking framework proves to be highly helpful when you are developing a Silverlight application. Moq is a simplest mocking library for .NET with a nice and simple API. It is a free and open source mocking framework.\
**Source Code:** <https://github.com/moq/Moq/>\
**Mock type:** Supports mocking interfaces as well as classes.

**3) FakeItEasy**

FakeItEasy is an amazing and simple to use framework and is compatible with both C# and VB.Net. It provides nice options for fake and dummy creation and argument formatting. Also, it provides friendly API support.\
**Source Code:** <https://github.com/FakeItEasy/FakeItEasy/>
