Testing Expectations

Even though we are stubbing methods on our mock objects we can still make sure that our code is interacting with the mock the way we want it to by laying down some expectations.

For example we can check that the method is called the correct number of times and with the correct arguments, even though the body of the method will no longer be executed. Cool 😎

Lesson Branch: https://github.com/GaryClarke/test-doubles/tree/testing-expectations


Complete and Continue  
Discussion

2 comments