Skip to content

A collection of awesome .NET libraries, tools, frameworks and software for writing tests, measuring code coverage, finding vulnerabilities, and ensuring code quality.

License

Notifications You must be signed in to change notification settings

ilya-chumakov/awesome-dotnet-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Awesome .NET Testing

Inspired by awesome-dotnet-core, awesome-dotnet. Contributions are always welcome!

Not included

  • 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).

Legend

[~] – 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.

Contents

Intro. Test frameworks

  • The Big Three: MSTest, NUnit, xUnit.

  • Fixie – A test framework similar to NUnit and xUnit, but with an emphasis on low-ceremony defaults and flexible customization.

Architecture

  • 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.

Assertions

  • 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.

Behavior Driven Development (BDD)

  • 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).

Code coverage

Coverage collection

  • .NET built-in coverage data collector – Can be called by dotnet test --collect "Code Coverage" command. To avoid confusion with dotnet-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.

Coverage visualization

  • 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.

Fake data generators

  • 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. [~]

Mocks

General purpose mocks

  • 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.

Specific mocks

  • 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.

Mutations

  • Stryker.NET – Mutation testing tool. It allows you to test your tests by temporarily inserting bugs in your source code. HowTo.

Random & fuzzy testing

Security

Snapshots

Web UI test automation

  • 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). [$]

Uncategorized

  • 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.

Appendix I. xUnit extensions

About

A collection of awesome .NET libraries, tools, frameworks and software for writing tests, measuring code coverage, finding vulnerabilities, and ensuring code quality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •