.NET Testing
.NET testing foundational skills overview and guidance hub. Triggered when users ask general testing questions such as "how to write .NET tests", ".NET testing getting started", "what testing tools are needed", "testing best practices", or "learn testing from scratch". It recommends appropriate combinations of subskills based on specific needs, covering 19 foundational skills including testing basics, test data, assertions, mocking, and special scenarios. Keywords: dotnet testing, .NET testing, testing getting started, how to write tests, testing best practices, unit test, xUnit, 3A pattern, FIRST principles, assertion, mock, stub, NSubstitute, test data, AutoFixture, Bogus, validator, FluentValidation, TimeProvider, IFileSystem, code coverage, ITestOutputHelper, test naming
dotnet-testing-bogus-fake-data
Specialized skill for generating realistic fake data using Bogus. Use it when you need believable names, addresses, phone numbers, emails, company info, etc. for testing. Covers Faker classes, multilingual support, custom rules, bulk generation, and more. Keywords: bogus, faker, fake data, realistic data, fake name, fake address, fake email, Faker<T>, RuleFor, Generate, faker.Name, faker.Address, faker.Internet, generate fake data, seed data
dotnet-testing-advanced
.NET advanced testing skills overview and guidance hub. Triggered when a user asks about “integration testing”, “API testing”, “containerized testing”, “microservice testing”, “test framework migration”, “Testcontainers”, “Aspire testing”, or other advanced testing needs. It recommends appropriate combinations of sub-skills based on specific requirements, covering 8 advanced skill areas including integration testing, Testcontainers, Aspire testing, and framework upgrades. Keywords: integration testing, API testing, container testing, containerized testing, microservice testing, advanced testing, Testcontainers, Aspire testing, WebApplicationFactory, TestServer, database testing, EF Core testing, MongoDB testing, Redis testing, Docker testing, microservice test, .NET Aspire, xUnit upgrade, TUnit, framework migration
dotnet-testing-filesystem-testing-abstractions
A specialized skill for testing file system operations using System.IO.Abstractions. Use this when you need to test File, Directory, Path operations or mock the file system. Covers IFileSystem, MockFileSystem, file read/write testing, directory operation tests, and more. Keywords: file testing, filesystem, file tests, filesystem testing, IFileSystem, MockFileSystem, System.IO.Abstractions, File.ReadAllText, File.WriteAllText, Directory.CreateDirectory, Path.Combine, mock file system, file abstraction
dotnet testing — Advanced Testcontainers Database
A specialized skill for containerized database testing using Testcontainers. Use when you need to test real database behavior with SQL Server/PostgreSQL/MySQL containers or when testing EF Core/Dapper. Covers container startup, database migrations, test isolation, container sharing, lifecycle management, automatic cleanup, and version consistency strategies. Keywords: testcontainers, container testing, database testing, MsSqlContainer, PostgreSqlContainer, MySqlContainer, EF Core testing, Dapper testing, Testcontainers.MsSql, Testcontainers.PostgreSql, GetConnectionString, IAsyncLifetime, CollectionFixture
dotnet-testing-advanced-webapi-integration-testing
Complete guide to ASP.NET Core WebApi integration testing. Use this when you need to run integration tests against WebApi endpoints or validate ProblemDetails error formats. Covers WebApplicationFactory, IExceptionHandler, multi-container orchestration with Testcontainers, Flurl URL construction, and HTTP assertions with AwesomeAssertions. Keywords: webapi integration testing, WebApplicationFactory, asp.net core integration test, webapi integration testing, IExceptionHandler, ProblemDetails, ValidationProblemDetails, AwesomeAssertions, Flurl, Respawn, Be201Created, Be400BadRequest, multi-container testing, Collection Fixture, global exception handling
Test Data Builder Pattern (dotnet)
Complete implementation guide for the Test Data Builder Pattern. Use when you need to create maintainable test data or simplify test setup for complex objects. Covers fluent interfaces, semantic factory methods, default value design, and Builder composition patterns. Keywords: test data builder, builder pattern for tests, object mother, fluent interface, UserBuilder, ProductBuilder, .With(), .Build(), AUser(), test data preparation, complex object construction, semantic testing
dotnet-testing-advanced-tunit-advanced
Complete guide to advanced TUnit usage. Use when you need to perform data-driven tests, dependency injection, or integration tests with TUnit. Covers MethodDataSource, ClassDataSource, Matrix Tests, and Properties filtering. Includes Retry/Timeout controls, WebApplicationFactory integration, and Testcontainers multi-service orchestration. Keywords: TUnit advanced, MethodDataSource, ClassDataSource, Matrix Tests, MatrixDataSource, MicrosoftDependencyInjectionDataSource, Property, Retry, Timeout, data-driven testing, test filtering, WebApplicationFactory TUnit, multi-container orchestration
dotnet-testing-test-output-logging
Complete guide to xUnit test output and logging. Use when implementing test output, diagnostic logging, or ILogger substitutes in xUnit tests. Covers ITestOutputHelper injection, the AbstractLogger pattern, and structured output design. Includes implementations of XUnitLogger, CompositeLogger, and a performance-test diagnostics tool. Keywords: ITestOutputHelper, ILogger testing, test output xunit, test output, test logging, AbstractLogger, XUnitLogger, CompositeLogger, testOutputHelper.WriteLine, test diagnostics, logger mock, test logs, structured output, Received().Log
dotnet-testing-advanced-tunit-fundamentals
Complete guide to getting started with the next-generation TUnit testing framework. Use when creating TUnit test projects or migrating from xUnit to TUnit. Covers Source Generator–driven test discovery, AOT compilation support, and fluent asynchronous assertions. Includes project creation, the [Test] attribute, lifecycle management, parallel control, and a syntax comparison with xUnit. Keywords: TUnit, tunit testing, source generator testing, AOT testing, next-generation testing framework, [Test], [Arguments], TUnit.Assertions, Assert.That, Before(Test), After(Test), NotInParallel, TUnit.Templates, Microsoft.Testing.Platform, TUnit vs xUnit, parallel execution
dotnet testing — FluentValidation testing
A specialized skill for testing FluentValidation validators. Use this when you need to create tests for Validator classes, validate business rules, or verify error messages. It covers full usage of FluentValidation.TestHelper, ShouldHaveValidationErrorFor, asynchronous validation, cross-property logic, and more. Keywords: validator, validator testing, fluentvalidation, validation testing, UserValidator, CreateOrderValidator, TestHelper, ShouldHaveValidationErrorFor, ShouldNotHaveValidationErrorFor, TestValidate, TestValidateAsync, validator tests, business rule validation
dotnet-testing-unit-test-fundamentals
.NET unit testing fundamentals and the specialized skills around the FIRST principles. Use when you need to create unit tests, learn test fundamentals, study the 3A (AAA) pattern, or master testing best practices. Covers the FIRST principles, the AAA pattern, Fact/Theory, the test pyramid, and more. Keywords: unit test, unit testing, test fundamentals, FIRST principle, 3A pattern, AAA pattern, Arrange Act Assert, Fact, Theory, InlineData, how to write tests, testing best practices, creating unit tests
dotnet-testing-xunit-project-setup
A specialized skill for creating and configuring xUnit test projects. Use this when you need to create a test project, set up project structure, configure NuGet packages, and organize test folders. Covers csproj settings, package management, project structure, xunit.runner.json configuration, and related topics. Keywords: xunit project, xunit setup, test project creation, test project setup, create test project, project structure, folder structure, xunit package, nuget packages, test suite, how to create test project, xunit configuration
dotnet-testing-autofixture-bogus-integration
Comprehensive guide to integrating AutoFixture with Bogus. Use when you need to combine AutoFixture and Bogus to produce test data that is both anonymous and realistic. Covers ISpecimenBuilder integration, hybrid generators, test data factories, and handling circular references. Keywords: autofixture bogus integration, autofixture bogus, bogus integration, Faker, EmailSpecimenBuilder, PhoneSpecimenBuilder, NameSpecimenBuilder, realistic test data, semantic data, hybrid generator, HybridTestDataGenerator, OmitOnRecursionBehavior, circular references
dotnet-testing-awesome-assertions-guide
Use AwesomeAssertions to write fluent, readable test assertions. Use this skill when you need to write clear assertions, compare objects, validate collections, or handle complex comparisons. Covers the full API including Should(), BeEquivalentTo(), Contain(), ThrowAsync(), and more. Keywords: assertions, awesome assertions, fluent assertions, assertion, fluent assertion, Should(), Be(), BeEquivalentTo, Contain, ThrowAsync, NotBeNull, object comparison, collection validation, exception assertions, AwesomeAssertions, FluentAssertions, fluent syntax
dotnet-testing-autofixture-nsubstitute-integration
AutoFixture and NSubstitute integration guide — implementing auto-mocking. Use when you need to automatically create mock objects and simplify tests that involve complex dependency injection. Covers AutoNSubstituteDataAttribute, the Frozen mechanism, and the Greedy constructor strategy. Includes custom handling for special dependencies such as IMapper (AutoMapper/Mapster). Keywords: autofixture nsubstitute, auto mocking, AutoNSubstituteDataAttribute, auto-mocking, Frozen, AutoNSubstituteCustomization, AutoFixture.AutoNSubstitute, Greedy, fixture.Freeze, Received(), Returns(), IMapper, AutoMapper, Mapster, mapper testing
dotnet-testing-autodata-xunit-integration
Complete guide to integrating AutoFixture with xUnit. Use when you need AutoData or InlineAutoData to simplify xUnit parameterized test data setup. Covers custom Customization and test data attributes to improve test readability and maintainability. Keywords: AutoData, InlineAutoData, AutoFixture xUnit, [AutoData], [InlineAutoData], AutoDataAttribute, ICustomization, DataAttribute, parameterized tests, Theory AutoData, MemberAutoData, test data attributes, fixture.Customize
dotnet-testing-test-naming-conventions
A specialized skill for test naming conventions and best practices. Use when you need to name test methods, improve test readability, or establish naming standards. Covers the three-part naming convention, suggestions for Chinese-language names, test class naming, and more. Keywords: test naming, naming conventions, naming standards, three-part naming, method_scenario_expected, how to name tests, test readability, naming best practices, test report, test documentation
Dotnet Testing - AutoFixture Basics
Basic skills for using AutoFixture to automatically generate test data. Use when you need to quickly create test objects, reduce boilerplate code, or enable anonymous testing. Covers Fixture.Create, CreateMany, handling circular references, integration with xUnit, etc. Keywords: autofixture, fixture, test data generation, anonymous testing, fixture.Create, CreateMany, fixture.Build, Create<T>, AutoFixture.Xunit2, OmitOnRecursionBehavior, IFixture, generate test data
dotnet-testing-private-internal-testing
Guidance on testing strategies for private and internal members. Use this when you need to test private or internal members, configure InternalsVisibleTo, or evaluate testability by design. Covers design-first testability thinking, reflection-based testing, refactoring with the strategy pattern, the AbstractLogger pattern, and a decision framework. Keywords: private method testing, internal member testing, InternalsVisibleTo, reflection testing, GetMethod, BindingFlags, Meziantou.MSBuild.InternalsVisibleTo, testability design, strategy pattern refactor, AbstractLogger pattern, decision framework
dotnet-testing-advanced-aspnet-integration-testing
Specialized skill for ASP.NET Core integration testing. Use when you need to test Web API endpoints, HTTP request/response, middleware, or dependency injection. Covers WebApplicationFactory, TestServer, HttpClient testing, in-memory database configuration, and more. Keywords: integration testing, integration tests, web API testing, WebApplicationFactory, TestServer, HttpClient testing, controller testing, endpoint testing, RESTful API testing, Microsoft.AspNetCore.Mvc.Testing, CreateClient, ConfigureWebHost, AwesomeAssertions.Web, Be200Ok, Be404NotFound, middleware testing, dependency injection testing
dotnet-testing-autofixture-customization
Comprehensive guide to advanced AutoFixture customization techniques. Use when you need to customize AutoFixture builders or define test-data generation rules for special types. Covers automatic integration with DataAnnotations, implementing ISpecimenBuilder, and priority/ordering management. Includes DateTime and numeric-range builders, generic design patterns, and fluent extension methods. Keywords: autofixture customization, autofixture customize, autofixture custom, specimen builder, ISpecimenBuilder, RandomDateTimeSequenceGenerator, NumericRangeBuilder, DataAnnotations autofixture, fixture.Customizations, Insert(0), custom builder, NoSpecimen, generic builder
dotnet-testing-code-coverage-analysis
Comprehensive guide to code coverage analysis. Use when you need to analyze code coverage, generate coverage reports, or configure CI/CD coverage checks. Covers Coverlet configuration, report generation, interpreting metrics, and integration with cyclomatic complexity. Includes Fine Code Coverage, VS Code built-in tools, and best practices. Keywords: code coverage, coverage analysis, coverage report, Coverlet, Fine Code Coverage, dotnet-coverage, ReportGenerator, line coverage, branch coverage, cyclomatic complexity, runsettings, cobertura
dotnet-testing-advanced-xunit-upgrade-guide
Complete upgrade guide from xUnit 2.9.x to 3.x. Use this when you need to upgrade xUnit v2 to v3 or to learn about xUnit v3 new features and breaking changes. Covers package updates, fixes for async void tests, and adjustments to IAsyncLifetime. Includes introductions to new features: Assert.Skip, Explicit tests, Matrix Theory, Assembly Fixtures. Keywords: xunit upgrade, xunit v3, xunit 3.x, xunit migration, xunit upgrade, xunit.v3, OutputType Exe, IAsyncLifetime v3, Assert.Skip, SkipUnless, SkipWhen, Explicit attribute, MatrixTheoryData, AssemblyFixture, breaking changes
Dotnet Testing - NSubstitute Mocking
A specialized skill for creating test doubles (Mock, Stub, Spy) using NSubstitute. Use it when you need to isolate external dependencies, simulate interface behavior, or verify method calls. Covers complete guidance on Substitute.For, Returns, Received, Throws, and more. Keywords: mock, stub, spy, nsubstitute, mocking, test double, repository (IRepository), service (IService), Substitute.For, Returns, Received, Throws, Arg.Any, Arg.Is, dependency isolation, mocking external services, dependency injection testing
Advanced .NET Testing — Testcontainers for NoSQL
Complete guide to Testcontainers NoSQL integration testing. Use when you need containerized integration tests for MongoDB or Redis. Covers MongoDB document operations, Redis five data structures, and the Collection Fixture pattern. Includes BSON serialization, index performance testing, data isolation strategies, and container lifecycle management. Keywords: testcontainers mongodb, testcontainers redis, mongodb integration test, redis integration test, nosql testing, MongoDbContainer, RedisContainer, IMongoDatabase, IConnectionMultiplexer, BSON serialization, BsonDocument, document model testing, cache testing, Collection Fixture
dotnet-testing-advanced-aspire-testing
.NET Aspire Testing: a complete guide to the integration testing framework. Use this when you need to test .NET Aspire distributed applications, configure AppHost tests, or migrate from Testcontainers to Aspire testing. Covers DistributedApplicationTestingBuilder, container lifecycle management, multi-service orchestration, Respawn configuration, and time-testable design. Keywords: aspire testing, .NET Aspire, DistributedApplicationTestingBuilder, AppHost testing, distributed testing, AspireAppFixture, IAsyncLifetime, ContainerLifetime.Session, cloud-native testing, multi-service integration, Aspire.Hosting.Testing, Respawn
dotnet-testing-datetime-testing-timeprovider
A specialized skill for testing time-dependent logic using TimeProvider. Use when you need to test DateTime, control the flow of time, handle timezone conversions, or test expiration logic. Covers TimeProvider abstraction, FakeTimeProvider time control, freezing and fast-forwarding time, and related techniques. Keywords: datetime, time testing, time-dependent testing, TimeProvider, FakeTimeProvider, DateTime.Now, time dependency, cache expiration, token expiration, Microsoft.Bcl.TimeProvider, GetUtcNow, SetUtcNow, Advance, time freeze, time freezing, time fast-forwarding