You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zoka-tech edited this page Mar 30, 2025
·
5 revisions
Introduction
Each layer has different responsibilities and therefore different things to test.
This section gives you an overview of what kind of logic, behavior, and edge cases should be covered in Storage, Service, and Server tests.
Even if files are not part of a layer, if they perform important tasks, they should still be tested.
Storage Layer
Database operations (CRUD)
Data relationships and foreign keys (e.g. Tree ↔ TreeCluster)
Transactions and rollback behavior
Handling of constraint violations
Behavior when context is canceled
Service Layer
Core business logic
Correct use of repository interfaces
Aggregation and calculation logic
Behavior on repository errors (error handling/fail paths)