ConditionalTest: clean up helper methods
This commit is contained in:
parent
419b298f5b
commit
ca49a94a7d
1 changed files with 28 additions and 8 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue