xUnit.net

Source: Wikipedia, the free encyclopedia.
xUnit.net
Original author(s)James Newkirk, Brad Wilson
Developer(s)Microsoft, Outercurve Foundation, .NET Foundation
Stable release
2.6.2[1]
/ November 18, 2023; 4 months ago (2023-11-18)
Apache License 2.0
Websitexunit.net

xUnit.net is a

.NET Core and [2] Mono
.

It is licensed under

ReSharper, CodeRush, and TestDriven.NET.[4] It is authored by James Newkirk and Brad Wilson.[5]

Example

Example of an xUnit.net test fixture:

using Xunit;

public class MyTests
{
    [Fact]
    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