Testing
Unit testing frameworks, assertion libraries, mocking, and test-driven development methodology.
Pages
- NUnit —
NUnitconstraint-based assertion model and test framework for .NET - xUnit —
xUnit.netfree, open-source, community-focused unit testing tool for .NET - MSTest —
MSTestunit testing framework for Visual Studio
TDD and Supporting Tools
Test-Driven Development methodology: write tests first, then implement to make them pass.
Key properties of a good unit test: atomic, deterministic, repeatable, order-independent, fast, and easy to set up.
Recommended reading:
- Growing Object-Oriented Software, Guided by Tests — Freeman & Pryce (2010)
- Test Driven Development By Example — Kent Beck (2002)
Mocking and assertion libraries:
MOQ(Moq) — mocking framework for .NET using lambda-based setup and verification- FluentAssertions — fluent assertion library for expressive, readable test assertions
Microsoft.AspNetCore.TestHost— integration testing host for ASP.NET Core applicationsOpenCover— open-source code coverage tool for all .NET frameworks
FakeItEasy
FakeItEasy — the easy mocking library for .NET 1.