In this chapter, we looked at what E2E testing is. We saw that we can write automated tests, but we've also come to understand the importance of manually testing the complete application from an end user perspective.
When we looked at factories, we saw an example of their use when it comes to database connectivity. We considered a scenario where our app will enable users to use a database of their choice. We load in a connection string, and then based on that connection string, the relevant database connection object is instantiated and returned for use. We saw how we could test our factories for each use case for each different database. Factories can be used in a number of different scenarios, and now you know what they are, how to use them, and most importantly, you know how to test them.
DI enables a single class to work with multiple different implementations of an interface. We saw this in action when we wrote our own dependency container. The...