DEV Community

Discussion on: Leaky abstraction and clean architecture template

Collapse
 
neman profile image
Nemanja Đorđević

I would never mock IRepository/IDbContext (data access) because there is no value in it.

Unit test is for Domain, and this is Application layer. It should be tested with integration tests.
And pipeline for them is nightly build.

Collapse
 
moesmp profile image
Mohsen Esmailpour

In this scenario, all domain models are anemic and there is no logic inside domain models. In .NET space most of the time models don't have behavior and logic exists inside service classes and mocking a repo inside service class can't be avoided.