---
title: "How to Test Vertical Slice Architecture"
url: https://daily.dev/posts/how-to-test-vertical-slice-architecture-j5kybyrnx
source_url: https://milanjovanovic.tech/blog/how-to-test-vertical-slice-architecture
type: article
source: "Milan Jovanović"
published: 2026-07-11T00:44:50.114Z
updated: 2026-07-11T00:45:09.775Z
tags: ["testing", ".net"]
reading_time: 7
upvotes: 7
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Test Vertical Slice Architecture

**[Milan Jovanović](https://daily.dev/sources/milanjovanovic)** · 7 min read · 7 upvotes · 0 comments

## Summary

Testing vertical slice architecture (VSA) requires a mindset shift away from mocking layers. The right unit to test is the slice itself: send a real HTTP request in, verify the database state out, using WebApplicationFactory and Testcontainers with a real Postgres instance. Fakes are reserved only for third-party services you don't own. Unit tests still apply for extracted domain logic with complex rules, while architecture tests enforce that slices don't reference each other. This approach catches routing, validation, mapping, and persistence bugs in one pass and survives internal refactoring because tests are coupled to behavior, not implementation.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://milanjovanovic.tech/blog/how-to-test-vertical-slice-architecture>

## Similar posts on daily.dev

- [Vertical slices, their ownership and external dependencies](https://daily.dev/posts/vertical-slices-their-ownership-and-external-dependencies-c1z1aieuo) · Architecture Weekly · 2 upvotes · 0 comments
- [To test, or not to Test? Part 3 – Make it easier to recover from a defect](https://daily.dev/posts/to-test-or-not-to-test-part-3-make-it-easier-to-recover-from-a-defect-u4fa1chcv) · We Are .NET · 0 upvotes · 0 comments
- [The Test Pyramid Is a Lie \(and What I Do Instead\)](https://daily.dev/posts/the-test-pyramid-is-a-lie-and-what-i-do-instead--ak2scchgz) · Milan Jovanović · 40 upvotes · 0 comments
- [Where Vertical Slices Fit Inside the Modular Monolith Architecture](https://daily.dev/posts/where-vertical-slices-fit-inside-the-modular-monolith-architecture-tz11rkcko) · Milan Jovanović · 35 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#.net](https://daily.dev/tags/.net)

[View this post on daily.dev](https://daily.dev/posts/how-to-test-vertical-slice-architecture-j5kybyrnx)
