
Collaboration and contract tests
A collaboration test is an example of interactions between the subject of the test and its collaborators. For convenience, speed, reliability, or isolation, collaborators are often replaced with test doubles. A contract test confirms assumptions made in test doubles. Writing tests for pure functions or methods with no side effects is straightforward. Given the input, when the behaviour is invoked, let me verify the expected outcome matches the actual outcome. ...