NSubstitute is designed for Arrange-Act-Assert (AAA) testing, so you just need to arrange how it should work, then assert it received the calls you expected once you're done. Because you've got more important code to write than whether you need a mock or a stub. It is an attempt to satisfy our craving for a mocking library with a succinct syntax that helps us keep the focus on the intention of our tests, rather than on the configuration of our test doubles. We've tried to make the most frequently required operations obvious and easy to use, keeping less usual scenarios discoverable and accessible, and all the while maintaining as much natural language as possible. There are already some great mocking libraries around for .NET, so why create another? We found that for all their great features, none of the existing libraries had the succinct syntax we were craving — the code required to configure test doubles quickly obscured the intention behind our tests.

Features

  • Perfect for those new to testing, and for others who would just like to to get their tests written with less noise and fewer lambdas
  • Simple, succinct, pleasant to use
  • Helpful exceptions
  • Don't sweat the small stuff
  • Just substitute for the type you need
  • NSubstitute is designed for Arrange-Act-Assert (AAA) testing

Project Samples

Project Activity

See All Activity >

Categories

Frameworks, Libraries

License

MIT License

Follow NSubstitute

NSubstitute Web Site

You Might Also Like
The Most Powerful Software Platform for EHSQ and ESG Management Icon
The Most Powerful Software Platform for EHSQ and ESG Management

Addresses the needs of small businesses and large global organizations with thousands of users in multiple locations.

Choose from a complete set of software solutions across EHSQ that address all aspects of top performing Environmental, Health and Safety, and Quality management programs.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of NSubstitute!

Additional Project Details

Programming Language

C#

Related Categories

C# Frameworks, C# Libraries

Registered

2022-09-15