Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: restructure directories and flatten sidebar navigation
Reorganize 7 old directories into 3 new ones:
- test-lifecycle/ + test-authoring/ → writing-tests/
- advanced/ + customization-extensibility/ + extensions/ + experimental/ → extending/
- parallelism/ → execution/ (merged in)
- advanced/performance-best-practices.md → guides/performance.md

Rewrite sidebars.ts:
- Remove emoji from all category labels
- Promote Assertions to top-level (was buried 3 levels deep)
- Flatten max nesting from 5 levels to 3
- Dissolve "Platform-Specific Scenarios" catch-all
- Merge Extensibility + Customization + Extensions into one section

Update all internal cross-references across 14 files.
Add missing frontmatter to 5 assertion docs.
Delete 4 stale _category_.json files.
  • Loading branch information
thomhurst committed Feb 26, 2026
commit 93ec7e5ed85795ff939e3cf3126ef483e0fe3d55
4 changes: 4 additions & 0 deletions docs/docs/assertions/awaiting.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 1
---

# Awaiting

In TUnit you `await` your assertions, and this serves two purposes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 3
---

# Chaining and Converting

TUnit allows you to chain assertions that change the type being asserted, enabling fluent and expressive test code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 4
---

# Returning Data via `await`

Sometimes, you may want your assertion to return a value, such as an item found in a collection, so you can use it in further assertions or logic.
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/assertions/member-assertions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 12
---

# Member Assertions

The `.Member()` method allows you to assert on object properties while maintaining the parent object's context for chaining. This is useful when you need to validate multiple properties of the same object.
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/assertions/regex-assertions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 13
---

# Regex Assertions

The `.Matches()` method allows you to validate strings against regular expressions and assert on capture groups, match positions, and match lengths. This is useful when you need to validate structured text like emails, phone numbers, dates, or extract specific parts of a string.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/benchmarks/methodology.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,6 @@ Found an issue with the benchmarks? [Open an issue](https://github.com/thomhurst

- [BenchmarkDotNet Documentation](https://benchmarkdotnet.org/articles/overview.html)
- [.NET Performance Best Practices](https://learn.microsoft.com/en-us/dotnet/framework/performance/)
- [TUnit Performance Best Practices](/docs/advanced/performance-best-practices)
- [TUnit Performance Best Practices](/docs/guides/performance)

*Last updated: {new Date().toISOString().split('T')[0]}*
7 changes: 0 additions & 7 deletions docs/docs/comparison/_category_.json

This file was deleted.

7 changes: 0 additions & 7 deletions docs/docs/examples/_category_.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/execution/test-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ or

`dotnet run --treenode-filter /*/*/*/AcceptCookiesTest` - To run all tests with the name `AcceptCookiesTest`

TUnit also supports filtering by your own [properties](../test-lifecycle/properties.md). So you could do:
TUnit also supports filtering by your own [properties](../writing-tests/test-context.md#custom-properties). So you could do:

`dotnet run --treenode-filter /*/*/*/*[MyFilterName=*SomeValue*]`

Expand Down
8 changes: 0 additions & 8 deletions docs/docs/experimental/_category_.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The above would generate two test cases with their respective display name as:
- "Test with: foo 1 True"
- "Test with: bar 2 False"

If you have custom classes, you can combine this with [Argument Formatters](customization-extensibility/argument-formatters.md) to specify how to show them.
If you have custom classes, you can combine this with [Argument Formatters](argument-formatters.md) to specify how to show them.

:::info
If you want to include a literal `$` in your display name, escape it as `$$`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public class MyTests
}
```

See [Property Injection - Discovery Phase Initialization](../test-lifecycle/property-injection.md#discovery-phase-initialization) for detailed guidance and best practices.
See [Property Injection - Discovery Phase Initialization](../writing-tests/property-injection.md#discovery-phase-initialization) for detailed guidance and best practices.

## Best Practices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,7 @@ for (int i = 0; i < 10000; i++) // Creates 10,000 tests!

## See Also

- [Test Context](../test-lifecycle/test-context.md) - Understanding TestContext and StateBag
- [Dynamic Tests](../experimental/dynamic-tests.md) - Pre-execution test generation
- [Test Context](../writing-tests/test-context.md) - Understanding TestContext and StateBag
- [Dynamic Tests](dynamic-tests.md) - Pre-execution test generation
- [Retrying](../execution/retrying.md) - Built-in retry mechanism comparison
- [Properties](../test-lifecycle/properties.md) - Test metadata and custom properties
- [Event Subscribing](../test-lifecycle/event-subscribing.md) - Test lifecycle event receivers
- [Event Subscribing](../writing-tests/event-subscribing.md) - Test lifecycle event receivers
7 changes: 0 additions & 7 deletions docs/docs/extensions/_category_.json

This file was deleted.

4 changes: 2 additions & 2 deletions docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ dotnet run --configuration Release --coverage --report-trx
**Important:** Do **not** install `coverlet.collector` or `coverlet.msbuild`. These packages are incompatible with TUnit because they require the VSTest platform, while TUnit uses the modern Microsoft.Testing.Platform.

For more details, see:
- [Code Coverage Documentation](../extensions/extensions.md#code-coverage)
- [Extensions Overview](../extensions/extensions.md)
- [Code Coverage Documentation](../extending/built-in-extensions.md#code-coverage)
- [Extensions Overview](../extending/built-in-extensions.md)

That's it. We're ready to write our first test.

Expand Down
10 changes: 5 additions & 5 deletions docs/docs/getting-started/running-your-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ As TUnit is built on-top of the newer Microsoft.Testing.Platform, and combined w

:::info

Please note that for the coverage and trx report, you need to install [additional extensions](../extensions/extensions.md)
Please note that for the coverage and trx report, you need to install [additional extensions](../extending/built-in-extensions.md)

:::

Expand Down Expand Up @@ -98,16 +98,16 @@ To continue your journey with TUnit, explore these topics:

**Core Testing Concepts:**
- **[Assertions](../assertions/getting-started.md)** - Learn TUnit's fluent assertion syntax
- **[Test Lifecycle](../test-lifecycle/setup.md)** - Set up and tear down test state with hooks
- **[Data-Driven Testing](../test-authoring/arguments.md)** - Run tests with multiple input values
- **[Test Lifecycle](../writing-tests/hooks-setup.md)** - Set up and tear down test state with hooks
- **[Data-Driven Testing](../writing-tests/arguments.md)** - Run tests with multiple input values

**Common Tasks:**
- **[Mocking](../test-authoring/mocking/index.md)** - Use mocks and fakes in your tests
- **[Mocking](../writing-tests/mocking/index.md)** - Use mocks and fakes in your tests
- **[Best Practices](../guides/best-practices.md)** - Write maintainable, reliable tests
- **[Cookbook](../guides/cookbook.md)** - Common testing patterns and recipes

**Advanced Features:**
- **[Parallelism](../parallelism/not-in-parallel.md)** - Control how tests run in parallel
- **[Parallelism](../execution/not-in-parallel.md)** - Control how tests run in parallel
- **[CI/CD Integration](../execution/ci-cd-reporting.md)** - Integrate TUnit into your pipeline

Need help? Check the [Troubleshooting & FAQ](../troubleshooting.md) guide.
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ TUnit is designed for performance at scale. Follow these guidelines to keep your
### Optimize Test Discovery

- Use AOT mode for faster test discovery and lower memory usage
- Keep data sources lightweight (see [Performance Best Practices](../advanced/performance-best-practices.md))
- Keep data sources lightweight (see [Performance Best Practices](performance.md))
- Limit matrix test combinations to avoid test explosion

### Optimize Test Execution
Expand Down Expand Up @@ -692,7 +692,7 @@ public async Task GetUserData()
}
```

For detailed performance guidance, see [Performance Best Practices](../advanced/performance-best-practices.md).
For detailed performance guidance, see [Performance Best Practices](performance.md).

## Summary

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public class OrderServiceTUnitMocksTests
- **AOT-compatible** — source-generated mocks work with Native AOT, trimming, and single-file publishing
- **Built-in capture** — every `Arg<T>` automatically captures values for inspection via `.Values` and `.Latest`

See the full [TUnit.Mocks documentation](../test-authoring/mocking) for setup, verification, argument matchers, and more.
See the full [TUnit.Mocks documentation](../writing-tests/mocking) for setup, verification, argument matchers, and more.
:::

### Partial Mocks and Spy Pattern
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/migration/mstest.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public async Task TestWithAttachment()
}
```

For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../test-lifecycle/artifacts.md).
For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../writing-tests/artifacts.md).

### Assert.Fail

Expand Down Expand Up @@ -1124,4 +1124,4 @@ public class ContextTests

TUnit includes built-in code coverage support. Do **not** use Coverlet — it is incompatible with TUnit's Microsoft.Testing.Platform.

See the [Code Coverage guide](../extensions/code-coverage.md) for setup and configuration.
See the [Code Coverage guide](../extending/code-coverage.md) for setup and configuration.
4 changes: 2 additions & 2 deletions docs/docs/migration/nunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public async Task TestWithAttachment()
}
```

For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../test-lifecycle/artifacts.md).
For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../writing-tests/artifacts.md).

### Combinatorial Testing

Expand Down Expand Up @@ -840,4 +840,4 @@ public static class AssemblyHooks

TUnit includes built-in code coverage support. Do **not** use Coverlet — it is incompatible with TUnit's Microsoft.Testing.Platform.

See the [Code Coverage guide](../extensions/code-coverage.md) for setup and configuration.
See the [Code Coverage guide](../extending/code-coverage.md) for setup and configuration.
4 changes: 2 additions & 2 deletions docs/docs/migration/xunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ public class TestWithAttachments
}
```

For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../test-lifecycle/artifacts.md).
For more information about working with test artifacts, including session-level artifacts and best practices, see the [Test Artifacts guide](../writing-tests/artifacts.md).

### Traits and Categories

Expand Down Expand Up @@ -1170,4 +1170,4 @@ public class UserServiceTests(DatabaseFixture dbFixture)

TUnit includes built-in code coverage support. Do **not** use Coverlet — it is incompatible with TUnit's Microsoft.Testing.Platform.

See the [Code Coverage guide](../extensions/code-coverage.md) for setup and configuration.
See the [Code Coverage guide](../extending/code-coverage.md) for setup and configuration.
2 changes: 1 addition & 1 deletion docs/docs/reference/command-line-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

:::info

Please note that for the coverage and trx report, you need to install [additional extensions](../extensions/extensions.md)
Please note that for the coverage and trx report, you need to install [additional extensions](../extending/built-in-extensions.md)

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public class Fixture : IAsyncDiscoveryInitializer // Changed from IAsyncInitial

**Performance note:** Solution 1 is preferred because discovery happens frequently (IDE reloads, project switches, `--list-tests`), and you want to avoid expensive operations during discovery when possible.

For detailed examples, see [Property Injection - Discovery Phase Initialization](test-lifecycle/property-injection.md#discovery-phase-initialization).
For detailed examples, see [Property Injection - Discovery Phase Initialization](writing-tests/property-injection.md#discovery-phase-initialization).

## Test Execution Issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It also takes an optional `Shared` argument, controlling whether you want to sha

Avoid mutating the state of shared objects within tests. Because tests run concurrently, the execution order is unpredictable, and shared mutable state leads to flaky tests.

The `SharedType` parameter controls how instances are shared across tests. See [Property Injection -- Sharing Strategies](../test-lifecycle/property-injection.md#sharing-strategies) for full details on the available options (`None`, `PerClass`, `PerAssembly`, `PerTestSession`, `Keyed`).
The `SharedType` parameter controls how instances are shared across tests. See [Property Injection -- Sharing Strategies](property-injection.md#sharing-strategies) for full details on the available options (`None`, `PerClass`, `PerAssembly`, `PerTestSession`, `Keyed`).

## Initialization and TearDown
If you need to do some initialization or teardown for when this object is created/disposed, simply implement the `IAsyncInitializer` and/or `IAsyncDisposable` interfaces
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class MyTestClass(SomeDependency dep)
}
```

The `ClassConstructorMetadata` parameter provides context about the test being constructed, including the test's data-source arguments and metadata. You can also implement [event-subscribing interfaces](test-lifecycle/event-subscribing.md) on the same class to get notified when a test finishes — useful for disposing objects after the test completes.
The `ClassConstructorMetadata` parameter provides context about the test being constructed, including the test's data-source arguments and metadata. You can also implement [event-subscribing interfaces](event-subscribing.md) on the same class to get notified when a test finishes — useful for disposing objects after the test completes.

## DependencyInjectionDataSourceAttribute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,4 @@ public class MyTests
1. **Preferred:** Return predefined values that don't require initialization
2. **Alternative:** Use `IAsyncDiscoveryInitializer` if you need discovery-time initialization

See [Property Injection - Discovery Phase Initialization](../test-lifecycle/property-injection.md#discovery-phase-initialization) for detailed guidance and examples.
See [Property Injection - Discovery Phase Initialization](property-injection.md#discovery-phase-initialization) for detailed guidance and examples.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@ public class DatabaseTests
- [Arguments Attribute](./arguments.md) - For compile-time constant data with inline metadata
- [Method Data Sources](./method-data-source.md) - For dynamic test data generation
- [Class Data Sources](./class-data-source.md) - For class-based test data
- [Display Names](../customization-extensibility/display-names.md) - For global display name formatting
- [Display Names](../extending/display-names.md) - For global display name formatting
Loading