testing
C# and .NET Unit Testing Articles, Tutorials & News
C# and .NET Unit Testing articles, tutorials, and news from the DotNetNews archive.
175 articles Updated Page 4 of 7
Browse additional C# and .NET Unit Testing articles from the DotNetNews archive.
C# and .NET Unit Testing articles
Page 4 of 7
Newest first
-
Force DbContext SaveChanges to throw exception during test
Josef Ottosson Issue #382
Forcing exceptions from Entity Framework Core during integration tests using interceptors.
-
.NET 10 and C# 14 updates
DotNetNews Issue #381
Issue #381 covers .NET 10 and C# 14, Azure Redis caching in Web APIs, Marten query models, Aspire dashboards, and AI app patterns.
-
TDD in .NET: Practicing TDD in a Web API Project
Medium Issue #360
Motivation: Why This Article?
-
Clean Architecture in .NET: Testing, Best Practices & Final Thoughts
Medium Issue #360
Part 4 — Making It Production-Ready
-
TDD in .NET: Refactoring Safely
Medium Issue #360
Why Developers Fear Refactoring (But Shouldn’t)
-
C# 14, AI and .NET pitfalls
DotNetNews Issue #359
A varied mix of C# 14 changes, AI app integration, Visual Studio tips, security, and real-world .NET troubleshooting for working developers.
-
MAUI, EF Core, and auth hardening
DotNetNews Issue #355
A varied .NET roundup with MAUI resources, EF Core migrations and bulk retrieval, authentication hardening, HttpClientFactory, and more.
-
7 FluentValidation Recipes for Clean ASP.NET Controllers
Medium Issue #354
Move validation out of controllers with FluentValidation: complex rules, custom validators, and DI-powered async checks. Continue reading on .Net Code Chronicles »
-
Why Do You Need To Write Architecture Tests in .NET
Dev Tips Issue #354
Explore how to write Architecture Tests with NetArchTest in .NET. Learn how Architecture Tests in .NET improve software quality, enforce and test design rules, prevent technical dept. Architecture Tes
-
ASP.NET Core pipeline, C# 14, and .NET 10 networking
DotNetNews Issue #349
A varied .NET roundup covering filters, middleware, dependency injection, testing, logging, LINQ performance, and new platform features.
-
Async, DI, and Blazor pitfalls
DotNetNews Issue #344
This issue covers async gotchas, DI guidance, Blazor Server memory leaks, EF Core queries, debugging tricks, and MAUI age verification.
-
TDD in .NET: Practicing with String Calculator
Medium Issue #342
Practicing TDD with a simple String Calculator
-
No more public partial class Program in .NET 10
Steven Giesel Issue #333
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!
-
TUnit — Why I Spent 2 Years Building a New .NET Testing Framework
Medium Issue #333
I started building TUnit around two years ago. For those who have followed the journey, you’ll be glad to see the recent release of…
-
New dotnet test Experience with Microsoft.Testing.Platform
YouTube Issue #330
.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.
-
Understanding Recursion in C# – Find Sum of N Natural Numbers
C# Corner Issue #324
Learn recursion in C# using ASP.NET WebForms! This tutorial explains how to calculate the sum of N natural numbers with a practical, step-by-step example.
-
Why Use the Unit of Work Pattern in .NET
Medium Issue #318
Build Consistent, Maintainable, and Testable ASP.NET Core Applications with the Unit of Work Pattern
-
10 Mind-Blowing C# Record Features You’re (Definitely) Not Using Right
blog.stackademic.com Issue #318
Most developers barely scratch the surface of what Records can do. Continue reading on Stackademic »
-
Testing HttpClient in .NET without Moq or NSubstitute
Medium Issue #316
How to unit test HTTP clients in .NET without relying on mocking frameworks (Moq or NSubstitute) using DelegatingHandler.
-
Automating Chrome Browser with Selenium in C#
C# Corner Issue #311
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...
-
️ How to Write Architecture Tests for Clean Architecture with .NET 9
Medium Issue #311
Maintaining a Clean Architecture isn’t just about writing layered code; it’s about ensuring that those layers stay clean, that…
-
11 Battle-Tested Tips for Unit Testing CQRS Handlers (with Moq, FluentAssertions, and xUnit) — from…
Medium Issue #310
If you want the full source code, join our community: Here
-
Use fixtures in xUnit for shared context in unit tests
Round The Code Issue #309
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...
-
Mocking HTTP Calls with HttpClientFactory in .NET
Medium Issue #305
Test External APIs Without the Internet: HttpClientFactory + Moq Explained — Build isolated and deterministic unit tests for your .NET app.