Part 3: Architecture Tests, In-Memory SQLite, and Scaling Vertical Slice Architecture
The third and final installment of a developer series on Vertical Slice Architecture (VSA) in .NET addresses key concerns around enforcing boundaries within a single Web API project. The article introduces automated architecture tests to prevent cross-slice dependencies and circular references that compiler-level project separation would otherwise block. Instead of traditional mock-heavy unit tests, the guide advocates using a SQLite in-memory database helper to run real SQL queries against an actual schema, making tests faster and more honest. Handlers are tested directly with 'new' instantiation rather than a DI container, with mocks reserved only for genuine external boundaries like event dispatchers or payment gateways. The piece also covers generating TypeScript contracts from the backend and outlines a migration path toward a Modular Monolith without requiring a full system rewrite.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in