Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Example  





2 See also  





3 References  





4 Further reading  





5 External links  














xUnit.net







Add links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From 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; 6 months ago (2023-11-18)

Repositorygithub.com/xunit/xunit/
Written inC#
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]

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]

References[edit]

  1. ^ "Releases · xunit/xunit". GitHub.
  • ^ "How to Test ASP.NET Core Web API". InfoQ.
  • ^ "About xUnit.net". GitHub. 4 November 2021.
  • ^ Kanjilal, Joydip (February 10, 2017). "How to work with xUnit.Net framework". InfoWorld.
  • ^ "Leaving Microsoft". Brad Wilson.
  • Further reading[edit]

    External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=XUnit.net&oldid=1215784813"

    Categories: 
    Extreme programming
    Unit testing frameworks
    Free software programmed in C Sharp
    Microsoft free software
    Software that uses Mono (software)
    Software using the Apache license
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Official website different in Wikidata and Wikipedia
     



    This page was last edited on 27 March 2024, at 02:47 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki