Created
October 11, 2016 09:30
-
-
Save iwein/e255104bc64e8a33fdd3868de5cced52 to your computer and use it in GitHub Desktop.
The anatomy of a good testcase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| public void shouldWorkAccordingToInstructions() { | |
| //given (instructor is a mock injected in a worker) | |
| given(instructor.getInstructions()).willReturn(particularInstructions); | |
| //when (operate the SUT) | |
| ParticularResult result = workerUnderTest.work(); | |
| //then | |
| then(instructor).should.getInstructions(); | |
| assertThat(result, is(createdAccordingTo(particularInstructions)); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment