-
-
Notifications
You must be signed in to change notification settings - Fork 94
Documentation Updates #2720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Updates #2720
Conversation
- Fixed version placeholder in installation.md (changed from $(TUnitVersion) to *) - Fixed syntax error in depends-on.md array syntax - Created advanced/extension-points.md documenting ITestExecutor, IHookExecutor, and event receivers - Created advanced/exception-handling.md with complete exception hierarchy documentation - Created test-authoring/generic-attributes.md for type-safe generic attribute usage - Created troubleshooting.md with common issues and solutions - Created advanced/performance-best-practices.md for test performance optimization - Enhanced test-context.md with service provider integration documentation - Enhanced awaiting.md with extensive complex assertion examples These improvements address missing documentation for key TUnit features and provide clearer guidance for developers with practical examples and best practices. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Changed UseTestExecutor to TestExecutor (the correct attribute name) - Changed RegisterEventReceiver to proper attribute-based registration - Added examples showing event receivers are implemented as attributes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR focuses on enhancing TUnit's documentation with comprehensive guides and examples. The main purpose is to provide developers with detailed reference materials covering troubleshooting, advanced usage patterns, and practical examples.
- Added extensive troubleshooting guide covering common issues and their solutions
- Enhanced assertion examples with complex scenarios and patterns
- Introduced documentation for dependency injection with TestContext
- Added comprehensive guides for advanced topics like performance optimization, extension points, and exception handling
- Created detailed documentation for generic attributes and their type-safe benefits
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
docs/docs/troubleshooting.md |
New comprehensive troubleshooting guide with 548 lines covering test discovery, execution issues, assertion failures, and platform-specific problems |
docs/docs/test-lifecycle/test-context.md |
Added service provider integration section explaining dependency injection access through TestContext |
docs/docs/test-authoring/generic-attributes.md |
New guide documenting generic attribute versions with type safety benefits and AOT compatibility |
docs/docs/test-authoring/depends-on.md |
Updated DependsOn attribute syntax to use modern C# array initialization |
docs/docs/getting-started/installation.md |
Simplified .csproj example to use wildcard version for TUnit package |
docs/docs/assertions/awaiting.md |
Enhanced with 287 lines of complex assertion examples covering chaining, collections, async operations, and performance testing |
docs/docs/advanced/performance-best-practices.md |
New comprehensive performance guide with optimization strategies for test discovery, execution, and CI/CD |
docs/docs/advanced/extension-points.md |
New detailed guide covering all TUnit extension interfaces and implementation patterns |
docs/docs/advanced/exception-handling.md |
New comprehensive exception handling guide covering TUnit's exception hierarchy and best practices |
- Fixed ITestDiscoveryEventReceiver to have only OnTestDiscovered method - Changed all event receiver methods to return ValueTask instead of Task - Fixed parameter types (TestRegisteredContext, no TestResult in OnTestEnd) - Fixed ITestRetryEventReceiver signature (only context and retryAttempt) - Updated example to show event receivers as attributes with correct signatures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Escaped <T> to <T> in all generic attribute headings - Prevents MDX from interpreting <T> as an HTML tag 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Added detailed section on nested property injection with automatic initialization - Included real-world example with test containers and WebApplicationFactory - Documented how TUnit resolves dependency graphs and manages object lifetimes - Added best practices and sharing strategies - Covered advanced scenarios including circular dependency detection This powerful feature enables advanced test orchestration with simple code, letting TUnit handle initialization order and object lifetimes automatically. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Enhanced Assertion Examples:
docs/docs/assertions/awaiting.mdwith detailed examples for complex assertions, including chaining, collection conditions, async operations, nested objects, exception details, and performance metrics. These examples demonstrate the flexibility of TUnit's assertion system.Dependency Injection with
TestContext:docs/docs/test-lifecycle/test-context.mdexplaining how to useTestContextto access dependency injection services. Examples include accessing loggers, working with scoped services, and integrating services in custom extensions and test lifecycle hooks.Code Consistency and Fixes:
DependsOnattribute syntax indocs/docs/test-authoring/depends-on.mdto usenew[]for specifying types, improving clarity and alignment with modern C# practices..csprojexample indocs/docs/getting-started/installation.mdto use a wildcard for the TUnit version, simplifying the setup process.