Skip to content

The class that cannot be tested

OrderService constructs its own new DatabaseClient() and new EmailSender() inside its constructor. Testing it requires a live database and sends real email.

What is the underlying design problem?