I've got a set up with a number of layers:
- Website
- Application / Service
- Domain (contains entities)
- Persistence (contains repositories)
I'm testing the persistence layer in isolation OK using data created in memory from a stub object.
Now, Im thinking about testing my Website layer. I know I should be testing it in isolation which Im thinking means creating a stub for the Application layer object it uses but this stub would need its own set of in memory data, duplicated in the stub in the persistence layer and I dont want to do duplicate this and manage it.
So my question is should the subject under test always work with stub objects from the layer below in order to be isolated and do they normally have their own set of data? Or is OK for my web method under test to call a lightweight object in the Application Layer which calls the Persistence layer with stub data?
Thanks for your help. This feels like the last bit of the puzzle for me ...