testing
C# and .NET Unit Testing Articles, Tutorials & News
C# and .NET Unit Testing articles, tutorials, and news from the DotNetNews archive.
132 articles Updated
C# and .NET Unit Testing work shows up across many DotNetNews issues because teams keep hitting the same implementation questions. C# and .NET Unit Testing is the verification side of C# delivery, from unit suites to the habits that keep regressions cheap.
Recurring subtopics in recent issues include C# unit testing, .NET unit tests, mocking C#, and test doubles .NET. When a subtopic never appears in the archive titles or excerpts, it is left out of this introduction.
Expect publisher tutorials, release notes, architecture write-ups, and field notes linked from DotNetNews issues. Start here is a short editorial shortlist for C# and .NET Unit Testing; the archive list is chronological and larger. Secondary angles such as C# unit testing and .NET unit tests appear when the archive actually covered them. Cross-links to xUnit for C# and .NET and Test-Driven Development in C# help when the problem spans more than one tag.
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
https://www.csharp.com/article/comprehensive-guide-to-unit-testing-with-mstest-in-c-sharp/.
-
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.
Archive
Page 1 of 6
Newest first
-
From generated code to trusted code with a unit-test agent
devblogs.microsoft.com Issue #512
A common request to a coding agent is only one line: Generate unit tests. That request leaves important questions open. Which code needs tests? Which test framework does the project use? Where should ...
-
Playwright Testing for ASP.NET Core Applications: A Practical Guide
c-sharpcorner.com Issue #508
Master Playwright for ASP.NET Core E2E testing. Learn setup, writing tests, best practices, and CI/CD integration for reliable web app validation.
-
Testing Minimal APIs: The Complete Playbook
medium.com Issue #507
Minimal APIs threw out the controller ceremony — which also means the old “just unit test the controller” playbook doesn’t fully apply…
-
Delete AutoMapper: explicit, compile-time DTO mapping that you can actually test
medium.com Issue #507
Reflection-based mappers feel like they save you work until the day a renamed property silently maps to null in production. Here is the…
-
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.