- Home
- .NET code examples
- xUnit v3 examples: Assert.Skip, TestContext & TheoryDataRow
xUnit v3 examples: Assert.Skip, TestContext & TheoryDataRow
xUnit 3 has been launched and including many features. These include assert methods for skipping tests, a new TestContext and new ways of adding theory data to unit tests.
Download the code example
You'll need to fill out the code example form. We will send you an email where you can download the code example.
Software
This is the software that will need to be installed onto your machine.
- Visual Studio 2022. Version 17.12.0 or above. It will work with the free community version.
- .NET 9 SDK. Version 9.0.0 or above.
How to run the unit tests
Open up RoundTheCode.XUnit3.sln in Visual Studio. Go to Test and Test Explorer in the top menu and run all the tests. They should all pass apart from the ones that are set up to skip.
RoundTheCode.XUnit3.UnitTests project, there is a test class for each of the features covered. These include:
SpeedConversionHelperSkipTests.cs-Skipassert methodsSpeedConversionHelperSkipAttributeTests.cs- UsingSkipproperties in theFactattributeSpeedConversionHelperTheoryDataRowTests.cs- TheTheoryDataRowtypeSpeedConversionHelperMatrixTheoryDataTests.cs- TheMatrixTheoryDatatypeSpeedConversionHelperTestContextTests.cs- TheTestContextinstance
Give us your anonymous feedback regarding this page, or any other areas of the website.
Watch .NET tutorials
Subscribe to our YouTube channel
Related code examples