Fun with NSubstitute and Fluent Assertions

Keywords: C#, NSubstitute, Fluent Assertions, Unit Test, Testing
Publish Date: 8/10/2015
Description: A tiny example of NSubsitute and Fluent Assertions

This is a basic example of Nsubstitute and Fluent Assertions.

Dependency injection using interfaces is critical to testing success. It's hard to test code that doesn't let you fake it's dependencies.

Download the sample Visual Studio Project (zipped).

Here is a quick .Net Fiddle of how you can 'Mock' or 'Substitute' pretty much anything that is not sealed by inheriting from it and applying the methods from an interface.

Comments (0):

Leave a Comment:

    Captcha Challenge