Skip to main content
SEMastery

Testing

Explore testing topics and best practices in the .NET ecosystem.

Level:
17 articles
intermediate

Testcontainers: Integration Testing Using Docker in .NET

A friendly .NET 10 guide to Testcontainers: spin up real databases in Docker for trustworthy integration tests, with xUnit, WebApplicationFactory, and clean cleanup.

13 minTestcontainers · integration testing
intermediate

Enforcing Software Architecture With Architecture Tests in .NET

Learn how to enforce software architecture in .NET using architecture tests with NetArchTest and ArchUnitNET, so your layers and rules stay safe over time.

12 minarchitecture tests · NetArchTest
beginner

5 Architecture Tests You Should Add to Your .NET Projects

Five simple architecture tests for .NET using NetArchTest. Protect layers, naming, and dependencies with code that fails the build when rules break.

12 minarchitecture tests · NetArchTest
beginner

Creating Data-Driven Tests With xUnit (.NET 10)

A friendly .NET 10 guide to data-driven tests in xUnit: Theory, InlineData, MemberData, ClassData, strongly typed TheoryData, and xUnit v3 tips.

11 minxUnit · data-driven tests
intermediate

Testcontainers Best Practices for .NET Integration Testing (.NET 10)

A friendly .NET 10 guide to Testcontainers: real databases in Docker, shared container fixtures, clean test isolation, faster CI, and the mistakes to avoid.

11 minTestcontainers · integration testing
intermediate

Feature Flags in .NET and How I Use Them for A/B Testing

A friendly .NET 10 guide to feature flags with Microsoft.FeatureManagement: on/off flags, percentage and targeting filters, and variants for A/B testing.

12 minfeature flags · A/B testing
beginner

Load Testing Microservices With C# and NBomber (.NET 10)

A beginner-friendly .NET 10 guide to load testing microservices with NBomber: write scenarios in plain C#, ramp up virtual users, and read the HTML report.

13 minNBomber · load testing
beginner

How to Test API Integrations Using WireMock.Net in .NET 10

A beginner-friendly .NET 10 guide to testing API integrations with WireMock.Net: stub HTTP responses, simulate errors and delays, and write reliable tests.

12 minWireMock.Net · integration testing
intermediate

Load Testing Kafka Pipelines With C# and NBomber in .NET 10

A beginner-friendly guide to load testing Kafka pipelines in .NET 10 with C# and NBomber: push messages, measure throughput, watch consumer lag, and read results.

13 minNBomber · Apache Kafka
beginner

Why Do You Need To Write Architecture Tests in .NET

Learn why architecture tests matter in .NET, how they stop your layers from drifting, and how tools like NetArchTest and ArchUnitNET keep your design safe.

13 minarchitecture tests · NetArchTest
intermediate

ASP.NET Core Integration Testing Best Practices (.NET 10)

A friendly .NET 10 guide to ASP.NET Core integration testing: WebApplicationFactory, real databases with Testcontainers, clean test isolation, and CI tips.

11 minintegration testing · ASP.NET Core
beginner

Shift Left With Architecture Testing in .NET

Learn how to shift left with architecture testing in .NET using NetArchTest and ArchUnitNET, so bad dependencies are caught early before they reach production.

11 minarchitecture tests · shift left
intermediate

Unit Testing Clean Architecture Use Cases in .NET

Learn to unit test Clean Architecture use cases in .NET with xUnit and NSubstitute. Simple, friendly guide with diagrams, tables, and real code.

11 minunit-testing · clean-architecture
intermediate

Simplify Assertions in Unit and Integration Tests With Verify in .NET

A friendly .NET 10 guide to Verify snapshot testing: cut long assertions, check big objects and JSON, and keep tests clean in xUnit, NUnit, and MSTest.

13 minVerify · snapshot testing
intermediate

.NET Aspire Integration Testing: Best Practices for Distributed Apps

Learn .NET Aspire integration testing the simple way. Start your whole app, wait for services, and test how they really work together.

12 mindotnet-aspire · integration-testing
intermediate

The Test Pyramid Is a Lie (And What I Do Instead) in .NET

The test pyramid says write mostly unit tests. In real .NET apps that often backfires. Here is the testing trophy and how I balance tests instead.

13 mintesting · test pyramid
intermediate

Testing Modular Monoliths: System Integration Testing in .NET 10

A friendly .NET 10 guide to system integration testing for modular monoliths: test module boundaries, cross-module flows, real databases with Testcontainers.

11 minmodular monolith · integration testing