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
99.99% Uptime for Your Most Critical Databases Icon
99.99% Uptime for Your Most Critical Databases

Sub-second maintenance. 2x read/write performance. Built-in vector search for AI apps.

Cloud SQL Enterprise Plus delivers near-zero downtime with 35 days of point-in-time recovery. Supports MySQL, PostgreSQL, and SQL Server.
Try Free
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