Software:xUnit.net
From HandWiki
Short description: Software testing framework for .NET software framework
![]() | |
![]() xUnit.net 1.9.1 GUI on Windows | |
Original author(s) | James Newkirk, Brad Wilson |
---|---|
Developer(s) | Microsoft, Outercurve Foundation, .NET Foundation |
Stable release | 2.6.2[1]
/ November 18, 2023 |
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 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
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
- Test automation
- List of unit testing frameworks for .NET programming languages (includes column indicating which are based on xUnit)
- JUnit
References
- ↑ "Releases · xunit/xunit". https://github.com/xunit/xunit/releases.
- ↑ "How to Test ASP.NET Core Web API". https://www.infoq.com/articles/testing-aspnet-core-web-api/.
- ↑ "About xUnit.net". 4 November 2021. https://github.com/xunit/xunit/blob/main/LICENSE.
- ↑ Kanjilal, Joydip (February 10, 2017). "How to work with xUnit.Net framework". https://www.infoworld.com/article/3168787/how-to-work-with-xunit-net-framework.html.
- ↑ "Leaving Microsoft". https://bradwilson.typepad.com/blog/2012/09/leaving-microsoft.html.
Further reading
- Ayobami, Adewole (2018). C# and .NET Core Test-Driven Development: Dive into TDD to create flexible, maintainable, and production-ready .NET Core applications. Packt Publishing. ISBN 978-1788299923.
- Nagel, Christian (2021). Professional C# and .NET. John Wiley & Sons. ISBN 978-1119797210.
External links
![]() | Original source: https://en.wikipedia.org/wiki/XUnit.net.
Read more |