Inspired by awesome-dotnet-core, awesome-dotnet. Contributions are always welcome!
- External language-independent tools, such as load generators, even if they are built on .NET.
- Projects that are long dead or can't run on the latest stable .NET.
- Purely commercial products without a free version (a free trial doesn't count as a free version).
[~] – May not be actively maintained at the moment, but still has community value and runs on the latest stable .NET.
[$] – Has a paid "pro" version, restrictive license, or closed source code.
- Intro. Test frameworks
- Architecture
- Assertions
- Behavior Driven Development (BDD)
- Code coverage
- Fake data generators
- Mocks
- Mutations
- Random & fuzzy testing
- Security
- Snapshots
- Web UI test automation
- Uncategorized
- Appendix I. xUnit extensions
-
Fixie – A test framework similar to NUnit and xUnit, but with an emphasis on low-ceremony defaults and flexible customization.
- ArchUnitNET – A library for checking the dependencies between classes, members, interfaces, and more.
- NetArchTest – A library for creating tests that enforce conventions for class design, naming and dependency in .NET code bases.
- ExpressionToCode – A library that generates valid, readable C# from an expression tree, inspired by PowerAssert.NET.
- Fluent Assertions – A set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. [$]
- NFluent – An assertion library which aims to fluent your .NET TDD experience.
- PowerAssert.NET – A .NET port of Groovy's PowerAssert. It prints an easy-to-understand decomposition of your assertion's expression tree (with values) whenever an assertion fails.
- Shouldly – An assertion framework which focuses on giving great error messages when the assertion fails while being simple and terse.
- BDTest – A testing and reporting framework focusing on BDD ideology. It can be used with other frameworks (such as MSTest, xUnit or NUnit) or standalone. Think of BDTest as a pure code-based alternative to SpecFlow.
- LightBDD – A framework for writing tests that are easy to read, easy to track during execution and summarize in user friendly report.
- Machine.Specifications (MSpec) – A "context/specification" test framework. [~]
- Reqnroll – A test automation tool to practice BDD. Reqnroll is a .NET port of Cucumber and it is based on the SpecFlow framework and code base (SpecFlow has reached end-of-life, its GitHub repo deleted).
- .NET built-in coverage data collector – Can be called by
dotnet test --collect "Code Coverage"
command. To avoid confusion withdotnet-coverage
please visit this thread. - AltCover – Instrumenting coverage tool for .NET and Mono.
- coverlet – A cross platform code coverage framework for .NET, with support for line, branch and method coverage.
- dotnet-coverage – A utility for collection coverage data of a running process, merging of coverage reports, binary
.coverage
file convertation. - JetBrains.dotCover.CommandLineTools – A console tool that allows you to run coverage analysis of unit tests or applications using the command-line prompt.
- Microsoft.CodeCoverage.Console – A closed-source coverage collector, available only with Visual Studio Enterprise. [$]
- MiniCover – A minimalist code coverage tool for .NET.
- Visual Studio:
- FineCodeCoverage – Free Visual Studio extension for test code coverage visualization.
- CodeRush.
- ReSharper + dotCover.
- Built-in support in Enterprise version.
- Rider: built-in support.
- VSCode: Coverage Gutters extension.
- AutoFixture – minimize the 'Arrange' phase of your unit tests by automating non-relevant setup. Auto-injecting mocks, auto-generation of test cases etc.
- Bogus – A simple fake data generator. It is fundamentally a C# port of faker.js and inspired by FluentValidation's syntax sugar.
- GenFu – Smartly building up objects to use for test and prototype data. It will walk your object graph and fill in the properties on your type with realistic looking data. [~]
- FakeItEasy – A .NET dynamic fake library for creating all types of fake objects, mocks, stubs etc.
- JustMock – A flexible and complete mocking tool for crafting unit tests. [$]
- Moq – Most popular, mock both interfaces and classes, strong-typed, has IntelliSense integration, no Record/Replay idioms.
- NSubstitute – A friendly substitute for .NET mocking libraries.
- mockhttp – Testing layer for Microsoft's HttpClient library.
- Moq.Contrib.HttpClient – A set of extension methods for mocking HttpClient and IHttpClientFactory with Moq.
- netDumbster – A fake SMTP server.
- Stubbery – A library for creating and running Web API stubs in .NET.
- Stryker.NET – Mutation testing tool. It allows you to test your tests by temporarily inserting bugs in your source code. HowTo.
- CsCheck – C# random testing library inspired by QuickCheck.
- FsCheck – F# random testing library inspired by QuickCheck.
- SharpFuzz – AFL-based fuzz testing for .NET. The basics of fuzzy testing.
- HCL AppScan CodeSweep – SAST extension for Visual Studio Code.
- PVS-Studio – SAST. Free for OSS. [$]
- snyk.io – SAST. Free for individual developers and small teams. [$]
- SonarQube – SAST. Community Edition is free & open source. [$]
- Meziantou.Framework.InlineSnapshotTesting – Snapshot tool to store snapshots into the code.
- Snapshooter – A snapshot tool based on the idea of Jest Snapshot Testing.
- Verify – A snapshot tool to simplify the assertion of complex data models and documents.
- Atata – A full-featured framework based on Selenium WebDriver.
- Playwright - End-to-end testing for modern web apps, supporting Chromium, WebKit, and Firefox browsers.
- PuppeteerSharp – A multi-purpose browser automation library.
- Telerik Test Studio – Functional UI, load/performance and API testing for web and WPF desktop applications. It is not based on Selenium or other Open Source frameworks but on the Telerik Testing Framework (proprietary). [$]
- NCrunch – Automatic concurrent (live) testing for Visual Studio and JetBrains Rider. [$]
- Expecto – A Smooth Testing framework for F# with tests as values. Unit testing, property based testing, performance testing and stress testing.
- FlaUI – Automated UI testing of Windows applications (Win32, WinForms, WPF, Store Apps etc.).
- Fuchu – A unit-testing library for F# with tests-as-values which makes DSLs extremely easy to create. [~]
- Meziantou.Extensions.Logging.InMemory - Log verification for Microsoft.Extensions.Logging.ILogger.
- MyTested.AspNetCore.Mvc – A strongly-typed unit testing library providing an easy fluent interface to test the ASP.NET Core, perfectly suitable for both MVC and API scenarios.
- ReportPortal – AI-powered test automation dashboard: real-time analytics, test results visualization, machine learning. [$]
- Serilog.Sinks.InMemory - Log verification for Serilog.
- Testcontainers – A library to support tests with throwaway instances of Docker containers. It is built on top of the .NET Docker remote API and provides a lightweight implementation to support your test environment.
- ReSharper Live Templates for xUnit.net - Add various Live Templates for xUnit.net to ReSharper.
- Xunit.Categories - Friendlier attributes to help categorize your tests.
- Xunit.Combinatorial - Parameterize your Xunit test methods: auto-generate parameters, generate all parameter combinations, or randomly generate values.
- Xunit.DependencyInjection - Use Microsoft.Extensions.DependencyInjection to resolve xUnit test cases.
- Xunit.SkippableFact - Report a "skipped" result in run time.