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

Other Useful Business Software
Build Securely on AWS with Proven Frameworks Icon
Build Securely on AWS with Proven Frameworks

Lay a foundation for success with Tested Reference Architectures developed by Fortinet’s experts. Learn more in this white paper.

Moving to the cloud brings new challenges. How can you manage a larger attack surface while ensuring great network performance? Turn to Fortinet’s Tested Reference Architectures, blueprints for designing and securing cloud environments built by cybersecurity experts. Learn more and explore use cases in this white paper.
Download Now
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