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.

Featured in Issue #439 April 22, 2026

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...

Featured in Issue #437 April 20, 2026

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…

Featured in Issue #435 April 16, 2026

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

Featured in Issue #427 April 06, 2026

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…

Featured in Issue #425 April 02, 2026

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...

Featured in Issue #422 March 30, 2026

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…

Featured in Issue #409 March 11, 2026

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…

Featured in Issue #405 March 05, 2026

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

Featured in Issue #394 February 18, 2026

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

Featured in Issue #392 February 16, 2026

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.

Featured in Issue #382 February 02, 2026

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?

Featured in Issue #360 January 01, 2026

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 »

Featured in Issue #354 December 24, 2025

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

Featured in Issue #342 December 08, 2025

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!

Featured in Issue #333 November 25, 2025

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.

Featured in Issue #330 November 20, 2025

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

Featured in Issue #324 November 12, 2025

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

Featured in Issue #318 November 04, 2025

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.

Featured in Issue #316 October 31, 2025

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...

Featured in Issue #311 October 24, 2025

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

Featured in Issue #310 October 23, 2025

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...

Featured in Issue #309 October 22, 2025

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.

Featured in Issue #305 October 16, 2025

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...

Featured in Issue #303 October 14, 2025

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.

Featured in Issue #292 September 29, 2025

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…

Featured in Issue #289 September 24, 2025

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!

Featured in Issue #280 September 09, 2025

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

Featured in Issue #278 September 05, 2025

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…

Featured in Issue #275 September 02, 2025

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…

Featured in Issue #273 August 29, 2025

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 »

Featured in Issue #272 August 28, 2025

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...

Featured in Issue #260 August 12, 2025

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...

Featured in Issue #259 August 11, 2025

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

Featured in Issue #255 August 05, 2025

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

Featured in Issue #250 July 29, 2025

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

Featured in Issue #247 July 24, 2025

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

Featured in Issue #245 July 22, 2025

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

Featured in Issue #239 July 14, 2025

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

Featured in Issue #237 July 10, 2025

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

Featured in Issue #207 May 29, 2025

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

Featured in Issue #204 May 26, 2025

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

Featured in Issue #197 May 15, 2025

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

Featured in Issue #187 May 01, 2025

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

Featured in Issue #177 April 17, 2025

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

Featured in Issue #175 April 15, 2025

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/

Featured in Issue #173 April 11, 2025

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/

Featured in Issue #172 April 10, 2025

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/

Featured in Issue #168 April 04, 2025

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/

Featured in Issue #156 March 19, 2025

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/

Featured in Issue #154 March 17, 2025

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

Featured in Issue #153 March 14, 2025

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

Featured in Issue #151 March 12, 2025

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

Featured in Issue #141 February 26, 2025

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

Featured in Issue #136 February 19, 2025

Issue also covered: ASP.NET Core, C#, .NET 9, EF Core, System.Text.Json, Visual Studio

Read this issue →

Related topics