con un clic
csharp-tunit
Get best practices for TUnit unit testing, including data-driven tests
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Get best practices for TUnit unit testing, including data-driven tests
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Generates EventCatalog documentation files (services, agents, events, commands, queries, domains, flows, channels, containers, ADRs, data products, entities, diagrams) with correct frontmatter, folder structure, and best practices. Use when user asks to "document a service", "document an agent", "document an AI agent", "create EventCatalog files", "add an event to the catalog", "document my architecture", "generate catalog documentation", "create documentation for my microservice", "document a database", "create an ADR", "document a data product", or "document an entity".
Enforces Behavior Driven Development. Use when: implementing new features, making significant code changes, adding functionality, refactoring behavior. Requires writing a Gherkin feature file first, getting user approval, then implementing.
Refresh the managed Spec Kit section in the coding agent context file
**WORKFLOW SKILL** — Deploy Aspire apps from AppHost models to Docker Compose, Kubernetes, Azure, or AWS. WHEN: "deploy Aspire app", "publish Aspire artifacts", "deploy to Azure Container Apps", "generate Kubernetes artifacts", "tear down Aspire deployment". INVOKES: aspire CLI, Aspire docs, target cloud/container CLIs. FOR SINGLE OPERATIONS: use generic Azure, Kubernetes, Docker, or AWS tools only when no Aspire AppHost exists.
**WORKFLOW SKILL** - First-run flow for adding Aspire to a repo. Picks `aspire new` (greenfield) or `aspire init` (existing repo), drops the AppHost skeleton, then hands off to `aspireify` for resource wiring. USE FOR: aspire init, aspire new, aspire-starter, aspire-ts-starter, aspire-py-starter, add Aspire to existing repo, scaffold Aspire app, bootstrap Aspire, no AppHost detected, install aspireify, generated .aspire/modules. DO NOT USE FOR: AppHost wiring on an existing AppHost (use aspireify), start/stop/wait (use aspire-orchestration), deploy/publish (use aspire-deployment), logs/traces (use aspire-monitoring), repo that already has an AppHost. INVOKES: aspire CLI (init, new, doctor), aspireify (handoff after skeleton drop). FOR SINGLE OPERATIONS: Run `aspire init` or `aspire new TEMPLATE` directly.
**ANALYSIS SKILL** - Observe Aspire apps: logs, traces, metrics, resource state, telemetry export, browser telemetry, and the standalone dashboard. Routes between local Aspire CLI, AKS workload diagnostics, and deployed Azure resource health. USE FOR: aspire logs, aspire otel logs, aspire otel traces, aspire otel spans, aspire describe, aspire ps, aspire export, aspire dashboard run, --include-hidden, browser logs in dashboard, WithBrowserLogs, App Insights query, AKS pod logs, container app logs. DO NOT USE FOR: start/stop/wait (use aspire-orchestration), deploy/publish/destroy (use aspire-deployment), AppHost code edits like WithBrowserLogs() (use aspireify), Azure provisioning (use azure-prepare). INVOKES: aspire CLI, azure-diagnostics (deployed Azure), kubectl + Container Insights. FOR SINGLE OPERATIONS: Run the aspire CLI command directly for quick log or describe lookups.
| name | csharp-tunit |
| description | Get best practices for TUnit unit testing, including data-driven tests |
Your goal is to help me write effective unit tests with TUnit, covering both standard and data-driven testing approaches.
[ProjectName].[TestType] (e.g., MyApp.UnitTests)CalculatorTests for Calculator)dotnet test for running tests[Test] attribute for test methods (not [Fact] like xUnit)Given[Condition]_When[Action]_Then[ExpectedResult] for clarity[Before(Test)] for setup and [After(Test)] for teardown[Before(Class)] and [After(Class)] for shared context between tests in a class[Before(Assembly)] and [After(Assembly)] for shared context across test classes[Before(TestSession)] and [After(TestSession)]actual.ShouldBe(expected))[DependsOn] attribute if needed)[Arguments] attribute for inline test data (equivalent to xUnit's [InlineData])[MethodData] for method-based test data (equivalent to xUnit's [MemberData])[ClassData] for class-based test dataITestDataSource[Arguments] attributes can be applied to the same test methodactual.ShouldBe(expected) for value equalityactual.ShouldBeSameAs(expected) for reference equalityactual.ShouldBeTrue() or actual.ShouldBeFalse() for boolean conditionsactual.ShouldBeNull() or actual.ShouldNotBeNull() for null checksactual.ShouldContain(item) or actual.ShouldNotContain(item) for collectionsactual.ShouldContain("substring") for string containmentactual.ShouldMatch(pattern) for regex pattern matchingactual.ShouldBeGreaterThan(value), actual.ShouldBeLessThan(value) for comparisonsactual.ShouldBeOfType<T>() for type assertionsactual.ShouldBeEmpty() or actual.ShouldNotBeEmpty() for collections and stringsShould.Throw<TException>(() => action) for sync exception testingShould.Throw<TException>(async () => await asyncAction) for async exception testingShould.NotThrow(() => action) to verify no exception is thrownawait needed except for async exception testing)[Repeat(n)] to repeat tests multiple times[Retry(n)] for automatic retry on failure[ParallelLimit<T>] to control parallel execution limits[Skip("reason")] to skip tests conditionally[DependsOn(nameof(OtherTest))] to create test dependencies[Timeout(milliseconds)] to set test timeouts[Category("CategoryName")] for test categorization[DisplayName("Custom Test Name")] for custom test namesTestContext for test diagnostics and information[WindowsOnly] for platform-specific tests[NotInParallel] to disable parallel execution for specific tests[ParallelLimit<T>] with custom limit classes to control concurrency[Repeat(n)] with [ParallelLimit<T>] for load testing scenarios[Fact] with [Test][Theory] with [Test] and use [Arguments] for data[InlineData] with [Arguments][MemberData] with [MethodData]Assert.Equal with actual.ShouldBe(expected)Assert.True with condition.ShouldBeTrue()Assert.Throws<T> with Should.Throw<T>(() => action)[Before(Test)]/[After(Test)]IClassFixture<T> with [Before(Class)]/[After(Class)]Why TUnit over xUnit?
TUnit offers a modern, fast, and flexible testing experience with advanced features not present in xUnit, such as asynchronous assertions, more refined lifecycle hooks, and improved data-driven testing capabilities. TUnit's fluent assertions provide clearer and more expressive test validation, making it especially suitable for complex .NET projects.