Recently I am heavily learning Test Driven Development and Domain Driven design. As you know With TDD you need to have a mocking libraries. So after doing on research on internet they are three libraries available in Microsoft.NET development world which are quite mature.
- Rhino Mocks
- NSubstitute
- Moq
Why I Choose NSubstitute:
Following are the reasons why I have chosen NSubstitute.- It is super easy to use. I don’t have to write very complex lamda expressions to mock objects.
- It works really fine with all framework of Test Driven Development
- As it is super easy to use you need to write very less code to mock objects.
- With other Visual Studio plugins like Resharper, Telerik Justcode its works perfectly and they are able to generate code for the same.
- It’s got fluent syntax and very easy to understand.
- It’s perfect for some one who is not mature enough for Test Driven Development.