Testing
2 posts tagged “Testing”.
June 2026
-
Test time-dependent code with TimeProvider
Code that calls
DateTime.UtcNowdirectly is hard to test. Since .NET 8,TimeProvidergives you a standard abstraction, and a fake one that you can move forward on demand.
May 2026
-
Integration tests against a real database
The EF Core in-memory provider doesn't behave like SQL Server, so tests pass and production fails. WebApplicationFactory plus Testcontainers lets you test the real thing.