blog tag

Fun with NSubstitute and Fluent Assertions

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

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).

http://nsubstitute.github.io/

http://www.fluentassertions.com/

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.

https://dotnetfiddle.net/GRSl11

Comments: 0
© Chadwick 2021