Misplaced Pages

xUnit.net

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Software testing framework for .NET software framework This article is about the xUnit.net software. For all unit-testing frameworks like '_Unit', see xUnit.
xUnit.net
xUnit.net 1.9.1 GUI on Windows
Original author(s)James Newkirk, Brad Wilson
Developer(s)Microsoft, Outercurve Foundation, .NET Foundation
Stable release2.6.2 / November 18, 2023; 13 months ago (2023-11-18)
Repositorygithub.com/xunit/xunit/
Written inC#
Operating systemWindows, macOS, Linux
Platform.NET Framework, .NET Core, Mono
TypeUnit testing tool
LicenseApache License 2.0
Websitexunit.net

xUnit.net is a free and open-source unit testing tool for the .NET Framework, written by the original author of NUnit. The software can also be used with .NET Core and Mono.

It is licensed under Apache License 2.0, and the source code is available on GitHub. xUnit.net works with Xamarin, ReSharper, CodeRush, and TestDriven.NET. It is authored by James Newkirk and Brad Wilson.

Example

Example of an xUnit.net test fixture:

using Xunit;
public class MyTests
{
    public void MyTest()
    {
        Assert.Equal(4, 2 + 2);
    }
}

After you compile the test, run it in your console:

C:\MyTests\bin\Debug>xunit.console MyTestLibrary.dll
xUnit.net console test runner (64-bit .NET 2.0.50727.0)
Copyright (C) 2007-11 Microsoft Corporation.
xunit.dll:     Version 1.9.1.0
Test assembly: C:\MyTests\bin\Debug\MyTestLibrary.dll
1 total, 0 failed, 0 skipped, took 0.302 seconds

See also

References

  1. "Releases ยท xunit/xunit". GitHub.
  2. "How to Test ASP.NET Core Web API". InfoQ.
  3. "About xUnit.net". GitHub. 4 November 2021.
  4. Kanjilal, Joydip (February 10, 2017). "How to work with xUnit.Net framework". InfoWorld.
  5. "Leaving Microsoft". Brad Wilson.

Further reading

External links

Microsoft free and open-source software (FOSS)
Overview
Software
Applications
Video games
Programming
languages
Frameworks,
development tools
Operating systems
Other
Licenses
Forges
Related
Category
Categories: