Implementing the observer pattern using TDD
We will see how we can use TDD to implement the observer pattern. We will use the red, green, and refactor life cycle of TDD to understand it in more detail.
Red step (code with error)
Let's try to add code, which has some dependency. Don't include dependency in the first step and see what error it's giving. Normally in the red step, we have some code with error, and then in next step we add proper code to make it green.