Page 3 of 4
LINQ Best Practices in C#
LINQ is one of C#'s most expressive features — you can filter, transform, and aggregate collections with code that reads almost like English. But it's also one of the easiest places to write code that...
Async/Await Pitfalls in C#
Async/await is one of the best things that happened to C#. It turned callback spaghetti into readable, linear code. But it comes with a set of traps that are easy to fall into and sometimes hard to di...
What's New in .NET 10 and C# 14
.NET 10 shipped in November 2025, and it's a Long-Term Support release — the kind of milestone that signals "yes, it's time to migrate." If you're still on .NET 6 or .NET 8, this is your gre...
Characterisation Tests in C#
We've covered a lot of ground in this testing series. Unit tests, TDD, mocking, integration testing, property-based testing — all of those assume you're working with code you understand, or code you'r...
Property-Based Testing with FsCheck
We've been building up a serious testing toolkit this week. We covered unit testing with xUnit, TDD, mocking with Moq, and integration testing in ASP.NET Core. All of those rely on example-based testi...
Integration Testing in ASP.NET Core
We've been building up a solid testing toolkit this week. We covered unit testing with xUnit, TDD, and mocking with Moq. Unit tests are great, but they only tell you that your individual pieces work i...
Imposter: Fast Source-Generated Mocks
Yesterday we covered Moq — the most popular mocking library in .NET. Today we're looking at Imposter, a newer library that takes a different approach: source generation.
Instead of creating mock objec...
Mocking with Moq in C#
Over the past couple of days we've covered unit testing with xUnit and Test-Driven Development. By now you're writing tests and letting them drive your design. But there's a problem that keeps coming ...
Test-Driven Development in C#
If you read yesterday's post on unit testing with xUnit, you've already got the tools you need to write tests. Today we're going to flip the script — instead of writing code first and tests after, we'...
Unit Testing in C# with xUnit
Throughout this design patterns series, testing has come up again and again. The Repository Pattern post showed an InMemoryOrderRepository and used it in a quick test example. The Dependency Injection...
Dependency Injection - Loosely Coupled Components
At the end of the Chain of Responsibility post I mentioned that every pattern in this series has depended on one thing: injecting interfaces rather than creating concrete types directly. We've been do...
Chain of Responsibility - Handling Requests
At the end of the Decorator Pattern post I mentioned that Chain of Responsibility passes a request through a sequence of handlers, each deciding whether to handle it, modify it, or pass it on. If you'...
Decorator Pattern - Behavior Without Modification
At the end of the Repository Pattern post I left you with a teaser: you can wrap a repository with a caching decorator, adding caching transparently without touching your business logic or your origin...
Repository Pattern - Abstracting Data Access
We've been working through a design patterns series. We've covered SOLID principles, composition over inheritance, the Strategy Pattern, and most recently the Factory Pattern. Today we're tackling som...
Factory Pattern - Hiding Object Creation
We've been working through a design patterns series covering SOLID principles, the Strategy Pattern, composition over inheritance, and memoisation. Today we're tackling something you hit every time yo...