NUnit vs XUnit for .net6+ microservices

This page summarizes the projects mentioned and recommended in the original post on /r/dotnet

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Xunit.Gherkin.Quick

    BDD in .NET Core - using Xunit and Gherkin (compatible with both .NET Core and .NET)

  • Extensible: Has some really good extension support. There are libs that provide some very interesting ways to use xunit, such as Xunit.Gherkin.Quick, xunit-spec, xunit-bdd, CoreBDD, and many others

  • Shouldly

    Should testing for .NET—the way assertions should be!

  • On a side note, something I would highly recommend NOT doing is using the built in assertion types for any of the test adapters. Without a doubt the hardest part of switching unit test frameworks is having to fix all your assertions which is why we use 3rd party assertions. The built-in assertions also tend to not be very feature rich and don't have the most helpful messages. We personally use FluentAssertions, but there are other options such as Shoudly or Should. I highly recommend picking one of them over the built in assertions. You will thank yourself later :)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • xunit-spec

    Specification testing for xunit

  • Extensible: Has some really good extension support. There are libs that provide some very interesting ways to use xunit, such as Xunit.Gherkin.Quick, xunit-spec, xunit-bdd, CoreBDD, and many others

  • xunit-bdd

    Small BDD Framework built on top of xUnit

  • Extensible: Has some really good extension support. There are libs that provide some very interesting ways to use xunit, such as Xunit.Gherkin.Quick, xunit-spec, xunit-bdd, CoreBDD, and many others

  • CoreBDD

    BDD framework for xUnit.net

  • Extensible: Has some really good extension support. There are libs that provide some very interesting ways to use xunit, such as Xunit.Gherkin.Quick, xunit-spec, xunit-bdd, CoreBDD, and many others

  • xUnit

    xUnit.net is a free, open source, community-focused unit testing tool for .NET.

  • Attachments: At this time you still cannot attach files to test runs, although the functionality finally is coming in V3!

  • should

    Should Assertion Library

  • On a side note, something I would highly recommend NOT doing is using the built in assertion types for any of the test adapters. Without a doubt the hardest part of switching unit test frameworks is having to fix all your assertions which is why we use 3rd party assertions. The built-in assertions also tend to not be very feature rich and don't have the most helpful messages. We personally use FluentAssertions, but there are other options such as Shoudly or Should. I highly recommend picking one of them over the built in assertions. You will thank yourself later :)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts