Unit Testing - Curated .NET Articles & Tutorials
Curated .NET news, articles, and tutorials about Unit Testing, drawn from .NET News Daily issues.
92 curated issues
How to Implement Unit Testing in .NET using xUnit with Example
Master .NET unit testing with xUnit! Learn to write effective tests, catch bugs early, and improve code quality. Includes practical examples and best practices.
Issue also covered: ASP.NET Core, Azure, Azure Functions, Clean Architecture, C#, Docker, EF Core, OpenAI
Read this issue →Testing Needs a Seam, Not an Interface
In my last video, I said that clean architecture was killing your velocity. And man, you guys had thoughts. The number one pushback, the hill a lot of people were willing to die on, was testing. And I...
Issue also covered: Azure, Clean Architecture, C#, .NET Core, EF Core, OpenAI, Performance, Semantic Kernel
Read this issue →Building an Open Source Assertion Library for .NET
Fluent Assertions did a great deal for .NET testing. For a long time, it made test code feel far more natural than it had before…
Issue also covered: ASP.NET Core, Benchmarking, Clean Architecture, C#, .NET 10, .NET Core, Performance, Redis
Read this issue →On .NET Live - Imposter: A Mocking Library
️ Featuring: Bitchiko Tchelidze (https://github.com/themidnightgospel/Imposter), Maira Wenzel, Cam Soper, Katie Savage https://github.com/themidnightgospel/Imposter
Issue also covered: ASP.NET Core, Authentication, Authorization, C#, .NET Core, EF Core, OpenAI, Security
Read this issue →The new Microsoft Testing Platform for .NET:
Testing in .NET has historically been associated with VSTest. That choice was reasonable for a long time because VSTest offered broad…
Issue also covered: ASP.NET Core, Blazor, C#, .NET 10, .NET Framework, EF Core, Kafka, .NET MAUI
Read this issue →Speed Up .NET CI with Test Sharding
A shard is a deterministic subset of your test suite. Test sharding means splitting one long test run into multiple smaller runs, and executing them in parallel in CI. Instead of waiting for one job t...
Issue also covered: ASP.NET Core, .NET Aspire, AutoMapper, Azure, Benchmarking, C#, .NET 10, EF Core
Read this issue →The End of Boilerplate: How Visual Studio 2026 is Automating the Testing Lifecycle
The latest February update for Visual Studio 2026 has introduced a feature that might finally kill the "testing debt" in most repositories…
Issue also covered: ASP.NET Core, Azure, Clean Architecture, C#, Design Patterns, .NET Core, EF Core, OpenAI
Read this issue →The End of Boilerplate: How Visual Studio 2026 is Automating the Testing Lifecycle
The latest February update for Visual Studio 2026 has introduced a feature that might finally kill the "testing debt" in most repositories…
Issue also covered: AOT, ASP.NET Core, Azure, Clean Architecture, C#, Design Patterns, EF Core, ML.NET
Read this issue →Testing for Memory Allocations in Unity
How to create a test to know if some code allocates in Unity
Issue also covered: Domain-Driven Design, .NET 10, EF Core, GitHub Copilot, gRPC, Performance, REST API, Security
Read this issue →Testing EF Core Without Losing Your Sanity
Introduction
Issue also covered: AOT, ASP.NET Core, Authentication, Authorization, C#, .NET Core, .NET Framework, EF Core
Read this issue →Force DbContext SaveChanges to throw exception during test
Forcing exceptions from Entity Framework Core during integration tests using interceptors.
Issue also covered: ASP.NET Core, Cosmos DB, C#, .NET 10, EF Core, .NET MAUI, MediatR, OpenAI
Read this issue →TDD in .NET: Practicing TDD in a Web API Project
Motivation: Why This Article?
Issue also covered: Azure, Benchmarking, Clean Architecture, C#, .NET 10, JWT, Minimal APIs, ML.NET
Read this issue →7 FluentValidation Recipes for Clean ASP.NET Controllers
Move validation out of controllers with FluentValidation: complex rules, custom validators, and DI-powered async checks. Continue reading on .Net Code Chronicles »
Issue also covered: .NET Aspire, Authentication, Authorization, Azure Functions, C#, .NET 9, FluentValidation, Performance
Read this issue →TDD in .NET: Practicing with String Calculator
Practicing TDD with a simple String Calculator
Issue also covered: ASP.NET Core, Azure, Clean Architecture, C#, Dapper, Domain-Driven Design, Design Patterns, .NET 10
Read this issue →No more public partial class Program in .NET 10
If you are using API Tests with the WebApplicationFactory you might did something like this to have a public Program class: public partial class Program; No more!
Issue also covered: Azure, Cosmos DB, C#, .NET 10, GitHub Copilot, Performance, Web API
Read this issue →New dotnet test Experience with Microsoft.Testing.Platform
.NET Aspire 13 — Simplified orchestration for cloud-native apps: https://aka.ms/aspire13/announcement Learn how the new platform works with popular testing frameworks like MSTest, NUnit, and xUnit.
Issue also covered: ASP.NET Core, .NET Aspire, Authentication, Clean Architecture, C#, Domain-Driven Design, .NET 10, .NET Core
Read this issue →.NET Web API Application Development Using ChatGPT-Part 2 Unit Testing
d
Issue also covered: ASP.NET Core, Azure, Blazor, Clean Architecture, C#, Docker, .NET 8, .NET 9
Read this issue →Why Use the Unit of Work Pattern in .NET
Build Consistent, Maintainable, and Testable ASP.NET Core Applications with the Unit of Work Pattern
Issue also covered: ASP.NET Core, Azure, Clean Architecture, C#, .NET 10, .NET Core, EF Core, MediatR
Read this issue →Testing HttpClient in .NET without Moq or NSubstitute
How to unit test HTTP clients in .NET without relying on mocking frameworks (Moq or NSubstitute) using DelegatingHandler.
Issue also covered: Application Insights, AutoMapper, Azure, Azure Functions, Clean Architecture, Domain-Driven Design, Design Patterns, Docker
Read this issue →Automating Chrome Browser with Selenium in C#
Learn how to automate the Chrome browser using Selenium WebDriver with C# for web testing, scraping, and task automation. This tutorial provides a step-by-step guide, from setting up your C# project i...
Issue also covered: .NET Aspire, Blazor, C#, Design Patterns, .NET 10, EF Core, GitHub Copilot, OpenAI
Read this issue →11 Battle-Tested Tips for Unit Testing CQRS Handlers (with Moq, FluentAssertions, and xUnit) — from…
If you want the full source code, join our community: Here
Issue also covered: ASP.NET Core, Azure, Azure DevOps, Azure Functions, CQRS, C#, Design Patterns, .NET 9
Read this issue →Use fixtures in xUnit for shared context in unit tests
Learn how to use xUnit fixtures like IClassFixture and ICollectionFixture to share setup and context across your unit tests efficiently. The page Use fixtures in xUnit for shared context in unit tests...
Issue also covered: Application Insights, ASP.NET Core, Azure, Clean Architecture, C#, Domain-Driven Design, Docker, .NET 9
Read this issue →Mocking HTTP Calls with HttpClientFactory in .NET
Test External APIs Without the Internet: HttpClientFactory + Moq Explained — Build isolated and deterministic unit tests for your .NET app.
Issue also covered: ASP.NET Core, Azure, .NET 9, EF Core, GitHub Copilot, gRPC, Minimal APIs, OpenTelemetry
Read this issue →Integrating GitHub Copilot with Playwright
This article provides a step-by-step approach to integrating Copilot into your Playwright workflow, covering IDE setup, resilient locators, Page Object Model implementation, CI/CD integration with Git...
Issue also covered: AOT, ASP.NET Core, Blazor, Clean Architecture, C#, Design Patterns, Docker, .NET 10
Read this issue →ASP.NET Community Standup - Vibe coding a C# MCP server
Unit testing for a .NET Web API project.
Issue also covered: ASP.NET Core, .NET Aspire, Authentication, Azure, C#, Design Patterns, .NET 10, EF Core
Read this issue →Types of Unit Tests in C# — Master Testing Like a Pro
Complete guide to unit testing in C#. Learn all types of tests: basic unit tests, mocks, parametrised tests, async testing, property-based…
Issue also covered: ASP.NET Core, Azure, C#, Design Patterns, .NET 10, .NET 8, EF Core, GitHub
Read this issue →C# Tip: injecting and testing the current time with TimeProvider and FakeTimeProvider
Dates used to be difficult to test. But with TimeProvider and FakeTimeProvider, everything becomes possible!
Issue also covered: .NET Aspire, Azure, C#, .NET 10, Minimal APIs, ML.NET, Performance, Security
Read this issue →Adding TDD to Legacy .NET Code Without Breaking Production
How to gradually introduce tests to existing Windows Forms, WPF, and WCF applications when “don’t break anything” is your #1 priority
Issue also covered: ASP.NET Core, Azure, Azure Functions, C#, EF Core, .NET MAUI, MongoDB, Performance
Read this issue →Beyond the Code: Why Testing in .NET is More Than Bug Hunting
When developers hear the word testing, the immediate thought is often about catching bugs. But in reality, testing is less about hunting…
Issue also covered: ASP.NET Core, Azure, Blazor, C#, .NET 9, EF Core, GitHub, .NET MAUI
Read this issue →Life Tracker — A .NET App 3: NUnit testing
It’s been a while since I last published a piece on LinkedIn. I wrote the draft of this post more than a month ago. Life in the new job…
Issue also covered: ASP.NET Core, Azure, Cosmos DB, C#, .NET Core, .NET Framework, GitHub Copilot, OpenAI
Read this issue →C# Complete Beginner Tutorial — Part 3
Welcome back to the C# Complete Beginner Tutorial Series-Part3. If you have followed along with Part 1 and Part 2, by now you should be… Continue reading on Dev Genius »
Issue also covered: ASP.NET Core, .NET Aspire, Clean Architecture, C#, .NET 10, .NET 9, .NET Core, EF Core
Read this issue →Selenium WebDriver Overview
Selenium WebDriver is a powerful tool for automating web browser interactions. It enables cross-browser testing, supports multiple languages, and is essential for robust and scalable test automation f...
Issue also covered: ASP.NET Core, .NET Aspire, C#, EF Core, Minimal APIs, OpenAI, Performance, Test-Driven Development
Read this issue →How to integration test exception handlers in ASP.NET Core
Global exception handling in ASP.NET Core is one of those features you often just set and forget. Unless you realize that your error log is awfully quiet, applications with failing or misconfigured ex...
Issue also covered: ASP.NET Core, C#, .NET 10, Performance, Security, Source Generators, SQL Server, Visual Studio
Read this issue →The Importance of Unit Testing in C#
Why It’s More than Just a Best Practice
Issue also covered: Azure, Clean Architecture, C#, JWT, Performance, REST API, Security
Read this issue →.NET Automated Testing
https://belitsoft.com/dot-net-automated-testing
Issue also covered: ASP.NET Core, Clean Architecture, .NET 9, EF Core, GitHub Copilot, Performance, RabbitMQ, Redis
Read this issue →Mock Smarter with WireMock.Net
https://medium.com/@technicalcolumns/mock-smarter-with-wiremock-net-31a60c2b4d6e
Issue also covered: Azure Functions, Blazor, Clean Architecture, C#, Design Patterns, .NET 10, .NET 9, .NET Core
Read this issue →How to Write Architecture Tests for the Clean Architecture in .NET 9
https://medium.com/@michaelmaurice410/how-to-write-architecture-tests-for-the-clean-architecture-in-net-9-db9e1d3443c9
Issue also covered: ASP.NET Core, Authentication, Authorization, Azure, Clean Architecture, C#, Dapper, Design Patterns
Read this issue →Report All JSON assertion errors in-one-shot for .NET
https://medium.com/@lateapexearlyspeed/report-all-json-assertion-errors-in-one-shot-for-net-2f4ee5175ca6
Issue also covered: ASP.NET Core, C#, EF Core, Native AOT, OpenAI, Performance, Serilog
Read this issue →Cracking the Code of Unit Testing in .NET
https://www.c-sharpcorner.com/blogs/cracking-the-code-of-unit-testing-in-net
Issue also covered: ASP.NET Core, Authentication, Azure, C#, .NET Core, EF Core, JWT, .NET MAUI
Read this issue →Mastering Moq in .NET
https://medium.com/@info_4533/mastering-moq-in-net-27c1a2623ada
Issue also covered: ASP.NET Core, Authentication, Azure, Blazor, CQRS, C#, Dapper, Design Patterns
Read this issue →25 .NET Interview Questions I Ask as a Hiring Manager (With Real Answers)
https://medium.com/@venkataramanaguptha/25-net-interview-questions-i-ask-as-a-hiring-manager-with-real-answers-28155ca575f3
Issue also covered: Azure, Azure Functions, Blazor, Cosmos DB, C#, Design Patterns, .NET 9, EF Core
Read this issue →C# .NET — Testing Persistence Layer with EF Core
https://medium.com/@gabrieletronchin/c-net-testing-persistence-layer-with-ef-core-fd108f3c1ffc?source=rss------csharp-5
Issue also covered: ASP.NET Core, Blazor, C#, Dapper, Docker, .NET 10, .NET Core, EF Core
Read this issue →Webhook Testing in C#: Your Own WireMock Alternative
https://medium.com/@vosarat1995/webhook-testing-in-c-your-own-wiremock-alternative-1439040931c3
Issue also covered: ASP.NET Core, Azure, Blazor, C#, .NET 10, .NET 9, .NET Core, EF Core
Read this issue →The Critical Importance of Unit Testing for APIs in C#.NET Development
https://medium.com/@S_Jathurshan/fae31535ff63
Issue also covered: ASP.NET Core, Azure, Azure Functions, Blazor, EF Core, Minimal APIs, OpenAI, Performance
Read this issue →Unit Testing in .NET
https://medium.com/@syed.zeeshan.ali.jafri_99339/unit-testing-in-net-cd01832966b1
Issue also covered: ASP.NET Core, Authentication, Azure, C#, .NET 10, .NET Core, EF Core, OpenAI
Read this issue →Comprehensive Guide to Unit Testing with MSTest in C#
https://www.c-sharpcorner.com/article/comprehensive-guide-to-unit-testing-with-mstest-in-c-sharp/
Issue also covered: ASP.NET Core, AutoMapper, Azure, C#, Domain-Driven Design, .NET 10, .NET 8, .NET 9
Read this issue →Explicit Loading in ASP.NET Core Web API
https://www.c-sharpcorner.com/article/explicit-loading-in-asp-net-core-web-api/
Issue also covered: ASP.NET Core, AutoMapper, Azure, Blazor, C#, .NET Core, EF Core, GitHub Copilot
Read this issue →Back to Basic: Fundamental Data Structure in C# (English Version)
https://naiwaen.debuggingsoft.com/2025/03/back-to-basic-fundamental-data-structure-in-csharp-english-version/
Issue also covered: .NET Aspire, Azure, Azure DevOps, C#, Domain-Driven Design, Docker, .NET 9, .NET Core
Read this issue →Comprehensive Guide to Unit Testing with MSTest in C#
https://www.csharp.com/article/comprehensive-guide-to-unit-testing-with-mstest-in-c-sharp/
Issue also covered: ASP.NET Core, Azure, C#, Dapper, .NET 8, .NET 9, .NET MAUI, Minimal APIs
Read this issue →Understanding in, ref, and out Parameter Modifiers in C#
https://www.csharp.com/article/understanding-in-ref-and-out-parameter-modifiers-in-c-sharp-with-practical-examp/
Issue also covered: AOT, Azure, Azure Functions, Blazor, C#, .NET 10, .NET 8, .NET 9
Read this issue →The Importance of Unit Testing in .NET Development
https://medium.com/@lalwanimihir23701/the-importance-of-unit-testing-in-net-development-a38097205ded
Issue also covered: ASP.NET Core, Azure, Blazor, C#, Docker, .NET Core, EF Core, Event Sourcing
Read this issue →Learning C#: Comparison Statements
https://medium.com/@MJQuinn/learning-c-comparison-statements-76047bf1f3fe
Issue also covered: ASP.NET Core, Azure, C#, .NET Core, EF Core, GitHub Copilot, .NET MAUI, Performance
Read this issue →GitHub Copilot Just Took Over My API Testing… And I’m Not Mad About It!
https://medium.com/@nidhiname/github-copilot-just-took-over-my-api-testing-and-im-not-mad-about-it-2e1bc9d50c53
Issue also covered: ASP.NET Core, Blazor, C#, EF Core, GitHub Copilot, .NET MAUI, Performance
Read this issue →Using Snapshot Testing to validate EF Core schema
https://www.meziantou.net/using-snapshot-testing-to-validate-ef-core-schema.htm
Issue also covered: ASP.NET Core, C#, .NET 9, EF Core, System.Text.Json, Visual Studio
Read this issue →