xUnit.net

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
xUnit.net
Original authorsJames Newkirk, Brad Wilson
DevelopersMicrosoft, Outercurve Foundation, .NET Foundation
Stable release
2.6.2[1] / November 18, 2023; 2 years ago (2023-11-18)
Repositorygithub.com/xunit/xunit/
Written inC#
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    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 [2] Mono.

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

    Example

    [edit | edit source]

    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

    [edit | edit source]

    Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).

    Further reading

    [edit | edit source]
    • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]