What’s Important to Get Right When Using Mocks?
Learn the right way to use mock in your tests.
We'll cover the following...
Best scenario
In the best case, we end up with a single-line arranged a portion of our test that creates an expectation using Mockito’s when(...).then(...)
construction. We have a single-line act and a single assert. These are tests we can quickly read, understand, and trust.
Tests using mocks should clearly state “what’s going on”.
Correlation
Tests using mocks should clearly state what is going on. One way we do this is by ...