| xUnit.net | |
|---|---|
xUnit.net 1.9.1GUI on Windows | |
| Original authors | James Newkirk, Brad Wilson |
| Developers | Microsoft,Outercurve Foundation,.NET Foundation |
| Stable release | |
| Repository | github |
| Written in | C# |
| Operating system | Windows,macOS,Linux |
| Platform | .NET Framework,.NET Core,Mono |
| Type | Unit testing tool |
| License | Apache License 2.0 |
| Website | xunit |
xUnit.net is afree and open-sourceunit testing tool for the.NET Framework, written by the original author ofNUnit. The software can also be used with.NET Core and[2]Mono.
It is licensed underApache License 2.0, and the source code is available onGitHub.[3] xUnit.net works withXamarin,ReSharper, CodeRush, andTestDriven.NET.[4] It is authored by James Newkirk and Brad Wilson.[5]
Example of an xUnit.nettest fixture:
usingXunit;publicclassMyTests{[Fact]publicvoidMyTest(){Assert.Equal(4,2+2);}}
After you compile the test, run it in your console:
C:\MyTests\bin\Debug>xunit.console MyTestLibrary.dllxUnit.net console test runner (64-bit .NET 2.0.50727.0)Copyright (C) 2007-11 Microsoft Corporation.xunit.dll: Version 1.9.1.0Test assembly: C:\MyTests\bin\Debug\MyTestLibrary.dll1 total, 0 failed, 0 skipped, took 0.302 seconds