Overview
AutoFixture ships extension packages that connect to tools you already use in .NET test projects. Each guide below covers the third-party library, what AutoFixture adds, and how to install both sides.
Pick the test framework you use, then add a mocking library if your tests need substitutes for interfaces or abstract types.
Test frameworks
These libraries run your tests. AutoFixture extensions add data attributes so method parameters become anonymous specimens ([AutoData] / [InlineAutoData] on xUnit and NUnit; [AutoDataSource] / [AutoArguments] on TUnit).
- xUnit.net 3 — AutoFixture 5
- NUnit 4 — AutoFixture 5
- TUnit — AutoFixture 4 (preview)
Mocking libraries
These libraries create test doubles. AutoFixture extensions register them as residue collectors so interfaces and abstract dependencies resolve to mocks, fakes, or substitutes when AutoFixture builds object graphs.
Related
- Custom AutoData attribute — share fixture setup (for example AutoMoq) across xUnit.net 3 theories
- NUnit 4 custom attributes — the same pattern for NUnit 4 tests
- TUnit custom AutoDataSource — the same pattern for TUnit tests
- AutoFixture integration packages — NuGet packages that wrap the libraries above
- v4 to v5 migration — map older xUnit.net and NUnit integration packages to v5
- FAQ — interfaces, Freeze, AutoData, and other common failures