Software Engineering is a vast knowledge area, always moving forward. However, developing good software is an arduous task until now. Furthermore, to achieve software of quality easier, engineers keep investigating common problems to design patterns solving then. As results, we have many known Design Patterns and Software Development Principles to make developers focus as much as possible on the client’s needs.
On the other hand, these principles and patterns are not well comprehended and applied by developers at the very beginning of their career, and even experienced ones can sometimes misuse or wrongly pick up some of those patterns.
When developing an application, we might face plenty of scenarios where dispatching an e-mail is required, maybe to warn a customer that something happened, alert some critical feature failure, send messages with attached files, several reasons indeed.
But while developing correlated e-mail features, It’s not a good idea to use a real SMTP client dispatching annoying test e-mails to somebody’s inbox, not even your’s.
This article will describe a Fake SMTP approach using the Dependency Injection pattern and Unit Test to help you test your e-mail contents.
To fully understand what is presented here, we expected you to be familiar…