I’m starting a new project and I want to use unit testing.
So I wrote my services classes which are implementing interface and waiting for interface in their parameters so I can easily mock these classes.
My question: there is absolutely no code in my business class! (like Customer)
Is it normal? is it normal even without unit test ? what kind of code would you put in a class like “Customer”?
No, it doesn’t sound normal to me – unless you are at the very beginning of your project and
Customeris as yet just a skeleton, and you know it will get more functionality over time.Otherwise it may be a sign of a design issue, such as an anemic domain model.
It is not the unit tests’ fault. Unit tests don’t in any way enforce one to create dumb classes without real functionality.