Jump to content

xUnit.net

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by PrimeHunter (talk | contribs) at 09:50, 27 May 2016 (remove invalid {{DISPLAYTITLE}}). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

xUnit.net
Developer(s)James Newkirk and Brad Wilson
Stable release
2.1 / September 27, 2015; 8 years ago (2015-09-27)
Repository
Written inC#
Operating systemMicrosoft .NET
TypeUnit testing tool
LicenseApache License 2.0
Websitegithub.com/xunit/xunit

xUnit.net is an open source unit testing tool for the .NET framework, written by the original author of NUnit.

Example

Example[1] 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

External links