How to unit test code that requires multiple side effects?
For example, making an invoice. Simple action requires few thing to happen simultaneously:
- create invoice in db
- send invoice to backend
- print slip
- open cash drawer (if cash payment)
I am having a hard time designing an object that does this and respects SRP, and therefore is easy to test.
Does anyone have advice on a good approach for this problem?