C# and .NET Unit Testing Articles, Tutorials & News
C# and .NET Unit Testing articles, tutorials, and news from the DotNetNews archive.
128 articles Updated
Start here
Editor picks for Unit Testing
-
How to Implement Unit Testing in .NET using xUnit with Example
c-sharpcorner.com Issue #439
A practical xUnit primer that fits newer .NET developers and teams trying to build better testing habits before bugs escape into production.
-
ASP.NET Community Standup - Vibe coding a C# MCP server
youtube.com Issue #292
The ASP.NET Community Standup on vibe coding a C# MCP server is a good snapshot of where the platform is headed.
-
Types of Unit Tests in C# — Master Testing Like a Pro
medium.com Issue #289
A thorough unit-testing guide covering mocks, async tests, and property-based testing.
-
Life Tracker — A .NET App 3: NUnit testing
jackymlui.medium.com Issue #273
The NUnit testing entry is a nice nod to the testing side of app development, even if it's more personal than prescriptive.
-
Cracking the Code of Unit Testing in .NET
c-sharpcorner.com Issue #237
Unit testing in .NET gets a familiar but valuable treatment for anyone trying to write more reliable code.
-
The Critical Importance of Unit Testing for APIs in C#.NET Development
medium.com Issue #177
Strong case for API unit tests here; reliability still starts with fast feedback.
-
Comprehensive Guide to Unit Testing with MSTest in C#
csharp.com Issue #156
The repository-pattern discussion should spark some healthy disagreement, which is usually a good sign.
-
How to Test Vertical Slice Architecture
milanjovanovic.tech Issue #495
Useful look at testing in vertical slice systems, especially if layered-architecture habits keep leaking into feature-based codebases.
C# unit testing from the DotNetNews archive, curated for .NET developers who already ship production code. This is a reading list pulled from daily issues, not a substitute for the official docs on C# and .NET Unit Testing.
Use Start here for the editorial shortlist, then browse Latest or the full archive when you need more depth. Coverage leans toward C# unit testing, .NET unit tests, mocking C#. Recent pieces worth opening: “How to Test Vertical Slice Architecture” and “Using AI to Generate Better Unit Tests for Bug Reproduction in .NET”.
Latest
Newest Unit Testing from the archive
-
How to Test Vertical Slice Architecturemilanjovanovic.tech Issue #495
-
Using AI to Generate Better Unit Tests for Bug Reproduction in .NETblog.stackademic.com Issue #495
-
Test Automation Best Practices with Microsoft Playwrightc-sharpcorner.com Issue #494
-
Mastering .NET Interviews – Part 9: Testing & Performancec-sharpcorner.com Issue #487
-
AI-Powered Test Case Generation for Enterprise .NET Applicationsc-sharpcorner.com Issue #485
Archive
Page 1 of 6
Newest first
-
How to Test Vertical Slice Architecture
milanjovanovic.tech Issue #495
The most common question I get about vertical slice architecture isn't about structure. It's "where do my tests go?" The layered-architecture testing habits (mock the repository, test the service) don...
-
Using AI to Generate Better Unit Tests for Bug Reproduction in .NET
blog.stackademic.com Issue #495
Turn bug reports into reliable unit tests using the AI Continue reading on Stackademic »
-
Test Automation Best Practices with Microsoft Playwright
c-sharpcorner.com Issue #494
Master Microsoft Playwright with best practices for reliable, scalable, and maintainable test automation. Boost confidence and speed.
-
No more regressions with Snapshot Tests in C# using Verify: a practical guide
code4it.dev Issue #493
Snapshot Tests are an uncommon type of test that focuses on checking that no regressions were introduced after a code refactoring. Let’s learn how they work and how to use the Verify NuGet libra...
-
Repository Pattern in C#: Build Clean, Testable, and Maintainable .NET Applications
medium.com Issue #490
Learn how the Repository Pattern works in modern .NET
-
GitHub Copilot Generated Our .NET Tests. It Missed What Mattered Most
medium.com Issue #489
There has been plenty of discussion recently about AI replacing parts of software testing, so we decided to see how far we could actually…
-
The mock-as-private-field pattern only half-works the way you think
medium.com Issue #488
I ran into this recently while cleaning up our test classes at work, and it’s a good example of how a pattern can be “correct” in one…
-
Mastering .NET Interviews – Part 9: Testing & Performance
c-sharpcorner.com Issue #487
Master .NET interviews: Learn unit/integration testing, mocking, DI, and performance tuning (caching, async, profiling).
-
AI-Powered Test Case Generation for Enterprise .NET Applications
c-sharpcorner.com Issue #485
Automate .NET test case generation with AI. Enhance coverage, reduce errors, and accelerate enterprise application delivery.
-
How to Simplify ASP.NET Core API Testing
medium.com Issue #484
When developing applications, we strive to avoid code duplication. We extract commonly used code into libraries and use DI containers to…
-
Learning Playwright with C#: My Journey Implementing a DI-Driven Test Framework
medium.com Issue #481
Following Karthik KK’s Playwright course, I rebuilt a DI-driven automation framework and documented the lessons I learned along the way.
-
GitHub Copilot Agent for Unit Tests: My Real-World Spargine Experiment
dotnettips.com Issue #473
After experimenting with the GitHub Copilot Agent during the 2026 Microsoft MVP Summit, the author faced numerous challenges, including code deletion, slow performance, and inconsistent adherence to c...
-
ASP.NET Core 10 Web API CRUD with EF Core - Complete .NET 10 Tutorial
codewithmukesh.com Issue #473
Build a production-ready .NET 10 Web API with EF Core 10 and PostgreSQL. CRUD operations, DDD, Minimal APIs, Scalar, code-first migrations, and best practices.
-
How to Implement Unit Testing in .NET using xUnit with Example
c-sharpcorner.com Issue #439
Master .NET unit testing with xUnit! Learn to write effective tests, catch bugs early, and improve code quality. Includes practical examples and best practices.
-
Testing Needs a Seam, Not an Interface
codeopinion.com Issue #437
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...
-
Building an Open Source Assertion Library for .NET
medium.com Issue #435
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…
-
On .NET Live - Imposter: A Mocking Library
youtube.com Issue #427
️ Featuring: Bitchiko Tchelidze (https://github.com/themidnightgospel/Imposter), Maira Wenzel, Cam Soper, Katie Savage https://github.com/themidnightgospel/Imposter
-
From QA Hand-Offs to Test-First .NET: The C# Developer’s Testing Fundamentals
medium.com Issue #427
If you’ve written C# for more than a few months, you’ve already met the QA wall.
-
The new Microsoft Testing Platform for .NET:
medium.com Issue #425
Testing in .NET has historically been associated with VSTest. That choice was reasonable for a long time because VSTest offered broad…
-
Speed Up .NET CI with Test Sharding
meziantou.net Issue #422
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...
-
SignalR scale out and C# performance
DotNetNews Issue #417
This issue covers Redis-backed SignalR scaling, C# performance tuning, ASP.NET Core middleware and DI lifetimes, plus CQRS, OOP, and readiness checks.
-
The End of Boilerplate: How Visual Studio 2026 is Automating the Testing Lifecycle
medium.com Issue #409
The latest February update for Visual Studio 2026 has introduced a feature that might finally kill the "testing debt" in most repositories…
-
Parallel code, Redis caching, and EF Core
DotNetNews Issue #407
A varied .NET roundup on performance, ASP.NET Core caching and CORS, EF Core polymorphism, async internals, serverless design, and security.
-
The End of Boilerplate: How Visual Studio 2026 is Automating the Testing Lifecycle
medium.com Issue #405
The latest February update for Visual Studio 2026 has introduced a feature that might finally kill the "testing debt" in most repositories…
-
ASP.NET Core monitoring and AI agent workflows
DotNetNews Issue #401
This issue covers ASP.NET Core health checks, AI agent workflow standards, API gateways, LINQ, migration guidance, and security tips.