- Home
- .NET code examples
- Exploring xUnit: Theory, Assert methods and Fixtures
Exploring xUnit: Theory, Assert methods and Fixtures
Exploring xUnit has a numer of tutorials which looks at the different Theory
attributes, what assert methods you can use in xUnit and how to use fixtures.
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.
The code example will be in a zip file and will include all the Exploring xUnit tutorials separated by a numeric folder name.
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.
Tutorials
Here are the different minimal API tutorials available:
How to use InlineData, MemberData and ClassData in xUnit
You can read more about how to use the InlineData, MemberData and ClassData attributes in xUnit, or watch the video:
In Visual Studio, open up 01/RoundTheCode.ExploringXUnit._01.sln
from the code example zip file that you downloaded.
Go to Test and Test Explorer in the top menu. Run all the tests and they should all pass.
Related code examples

TimeProvider example for mocking time and timer in xUnit
A .NET 8 xUnit project which uses the TimeProvider and FakeTimeProvider class to mock time and a timer in unit tests.