From Wikipedia, the free encyclopedia
Jump to: navigation, search
This article is about the xUnit.net software. For all unit-testing frameworks like '_Unit', see xUnit.
XUnit.net Logo.png
XUnit.net GUI.png
xUnit.net 1.9.1 GUI on Windows
Developer(s) James Newkirk and Brad Wilson
Stable release 1.9.2 / August 24, 2013; 16 months ago (2013-08-24)
Written in C#
Operating system Microsoft .NET
Type Unit testing tool
License Apache License 2.0
Website github.com/xunit/xunit

xUnit.net is an open source unit testing tool for the .NET framework. Written by the original inventor of NUnit, xUnit.net is the latest technology for unit testing C#, F#, VB.NET, and other .NET languages.


Example[1] 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
Test assembly: C:\MyTests\bin\Debug\MyTestLibrary.dll

1 total, 0 failed, 0 skipped, took 0.302 seconds

See also[edit]


External links[edit]