Generates and writes new unit tests for any programming language using a Research-Plan-Implement-Validate pipeline, orchestrated by the main agent through IDE subagents. Use when asked to generate tests, write unit tests, add tests, improve test coverage, create test project, achieve high coverage, comprehensive tests, or asked to scaffold a new test project for an app, service, or library. Supports C#, TypeScript, JavaScript, Python, Go, Rust, Java, and more. You (the main agent) launch the code-testing-researcher-ide, code-testing-planner-ide, code-testing-implementer-ide, and code-testing-validator-ide subagents in sequence so tests compile, pass, and follow project conventions. DO NOT USE FOR: running existing tests or test filters (use run-tests); diagnosing coverage plateaus or project-wide coverage/CRAP analysis without writing tests (use coverage-analysis); targeted method/class CRAP scores (use crap-score); MSTest assertion guidance, MSTest test pattern modernization, or fixing existing MSTest test c
Generates and writes new unit tests for any programming language using a Research-Plan-Implement pipeline. Use when asked to generate tests, write unit tests, add tests, improve test coverage, create test project, achieve high coverage, comprehensive tests, or asked to scaffold a new test project for an app, service, or library. Supports C#, TypeScript, JavaScript, Python, Go, Rust, Java, and more. Orchestrates the code-testing-generator sub-agent through research, planning, and implementation phases so tests compile, pass, and follow project conventions. DO NOT USE FOR: running existing tests or test filters (use run-tests); diagnosing coverage plateaus or project-wide coverage/CRAP analysis without writing tests (use coverage-analysis); targeted method/class CRAP scores (use crap-score); MSTest assertion guidance, MSTest test pattern modernization, or fixing existing MSTest test code (use writing-mstest-tests).
Migrate xUnit, NUnit, or MSTest test suites to TUnit. Use whenever the user wants to port tests from another framework to TUnit, or asks how to convert specific patterns: [Fact]/[Theory]/[InlineData]/IClassFixture (xUnit), [TestCase]/[TestCaseSource]/[SetUp]/[OneTimeSetUp] (NUnit), [TestClass]/[TestMethod]/[DataRow]/[DynamicData]/[TestInitialize] (MSTest). Covers attribute mapping tables, the assertion-shape change to `await Assert.That(...).IsEqualTo(...)`, the project-file changes (Microsoft.Testing.Platform, dotnet run vs dotnet test), the async-Task-by-default test signature, and the universal pitfalls when switching from sync-result Assert.Equal to awaited Assert.That.
Make TUnit test projects work under NativeAOT, IL trimming, and single-file publishing. Use when the user is publishing a TUnit test project with PublishAot=true, hits TUnit0058 errors about generic tests, sees IL2026/IL3050 trim warnings on test data sources, asks about [GenerateGenericTest], or needs to combine [ClassConstructor<T>] with the trimmer's DynamicallyAccessedMembers requirements. Also use when the user asks how to keep custom IClassConstructor or DataSourceGenerator implementations AOT-safe, or what restrictions apply to data sources under AOT (no reflection-based generators, static methods only).
TUnit's source-generated, AOT-compatible mocking framework — TUnit.Mocks. Use whenever the user is mocking dependencies in TUnit tests, references Mock.Of<T>(), `.Mock()` extension methods, `Any()`, `Is<T>(...)`, `WasCalled(Times.Once)`, or asks how to stub HttpClient/ILogger/ILogger<T> in TUnit. Also use when the user mentions the TUnit.Mocks, TUnit.Mocks.Http, or TUnit.Mocks.Logging packages, or asks how to verify mock calls without Moq/NSubstitute. Covers mock creation, setup (Returns/Throws/Callback/sequences/properties), argument matchers, call verification with the Times constraints, ordered verification, HTTP request matching and verification, and ILogger entry assertions.
Write new MSTest unit tests and implement concrete fixes in existing MSTest code using MSTest 3.x/4.x modern APIs and best practices. USE FOR: write unit tests for a class, write MSTest tests, create test class, fix test assertions, MSTest assertion APIs (StartsWith, EndsWith, MatchesRegex, IsGreaterThan, IsInRange, HasCount, IsNull), something seems off with my tests, review tests and fix issues, fix swapped Assert.AreEqual arguments, replace ExpectedException with Assert.Throws, modernize test patterns, convert DynamicData to ValueTuples, data-driven tests, test lifecycle setup, sealed test classes, async test patterns, cancellation token testing, test parallelization, Parallelize, DoNotParallelize, MSTest.Sdk project setup. DO NOT USE FOR: broad test quality audits or test smell detection (use test-anti-patterns), running tests (use run-tests), MSTest version migration (use migrate-mstest-v1v2-to-v3 or migrate-mstest-v3-to-v4), or non-.NET languages (Python/JS/Go/Java/etc.) — this is .NET-only.
Best practices for writing TUnit unit and integration tests. Use whenever the user is writing, fixing, reviewing, or modernizing TUnit tests, or asks about [Test], [Arguments], [Before(Test)]/[After(Test)], [MethodDataSource], [ClassDataSource], [MatrixDataSource], hooks, lifecycle, parallelism, timeouts, or `await Assert.That(...)`. Also use when the user references TUnit attributes without naming the framework, or when test files import `TUnit.Core` / `TUnit.Assertions`. Covers project setup on Microsoft.Testing.Platform, the async-by-default model, data-driven tests, lifecycle hooks at four scopes, parallelism control, retries, skipping, and the awaited-assertion pattern.
HttpContext lifecycle and thread-safety violations in ASP.NET Core - fire-and-forget patterns capturing HttpContext or scoped services, sync-over-async on request/response bodies, accessing HttpContext from parallel tasks or after request completion, response header timing after body writes.