Testing .NET Web APIs from A to Z
summary
Concrete recipe and results: a minimal .NET Todo API is built and tested end to end against a real SQL Server instance, tests run sequentially with the DB reset before each test, time is controlled with a manual TimeProvider so timestamps are deterministic, and an Alba host (WebApplicationFactory) plus Verify and a JSON diff library enable semantic JSON comparison and snapshot testing. Testcontainers and Respawn appear as options for external deps, and the demo tests run fast and catch contract and behavioral regressions.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:47Valuable API tests
- 8:04Four pillars of tests
- 10:56API testing toolbox
- 17:17Demo solution
- 23:35Contract testing with snapshots
- 27:26Verifying API behavior
- 34:31Implementation vs public API
- 38:04Controlling time in tests
- 40:09Summary
related talks
01h 02mTesting First - Getting The How
45mTesting Your Web Apps
39mMake .Net Automation Great Again
52mBuilding Operable Software with TDD (but not the way you think)
58mTesting strategy for your ASP.NET Core micro-service
50mCreate Web APIs with ASP.NET Core Using Outside In TDD
46mClean Testing: Clean Architecture with .NET Core
56mBuilding Operable Software with TDD (but not the way you think)
