ConditionalTest: clean up helper methods

This commit is contained in:
Paul Campbell 2017-04-21 18:10:14 +01:00
parent 419b298f5b
commit ca49a94a7d

View file

@ -180,23 +180,43 @@ public class ConditionalTest {
} }
private void thenBothResponsesRun() { private void thenBothResponsesRun() {
assertThat(thenFlag).isTrue(); theThenResponseRan();
assertThat(otherwiseFlag).isTrue(); theOtherwiseResponseRan();
} }
private void thenTheThenResponseRuns() { private void thenTheThenResponseRuns() {
assertThat(thenFlag).isTrue(); theThenResponseRan();
assertThat(otherwiseFlag).isFalse(); theOtherwiseResponseDidNotRun();
} }
private void thenTheOtherwiseResponseRuns() { private void thenTheOtherwiseResponseRuns() {
assertThat(thenFlag).isFalse(); theThenResponseDidNotRun();
assertThat(otherwiseFlag).isTrue(); theOtherwiseResponseRan();
}
private void theOtherwiseResponseRan() {
assertThat(otherwiseFlag).as("otherwise response runs")
.isTrue();
}
private void theThenResponseRan() {
assertThat(thenFlag).as("then response runs")
.isTrue();
}
private void theOtherwiseResponseDidNotRun() {
assertThat(otherwiseFlag).as("otherwise response does not run")
.isFalse();
}
private void theThenResponseDidNotRun() {
assertThat(thenFlag).as("then response does not run")
.isFalse();
} }
private void thenNoResponseRuns() { private void thenNoResponseRuns() {
assertThat(thenFlag).isFalse(); theThenResponseDidNotRun();
assertThat(otherwiseFlag).isFalse(); theOtherwiseResponseDidNotRun();
} }
private void when(final boolean firstClause, final boolean secondClause) { private void when(final boolean firstClause, final boolean secondClause) {