ConditionalTest: tidy up

This commit is contained in:
Paul Campbell 2017-08-26 12:49:11 +01:00
parent fd947df855
commit a78f6de32b

View file

@ -218,19 +218,6 @@ public class ConditionalTest {
assertThatNoResponseRuns(); assertThatNoResponseRuns();
} }
private void whenOr(final boolean firstClause, final boolean secondClause) {
Condition.where(firstClause)
.or(secondClause)
.then(thenResponse)
.otherwise(otherwiseResponse);
}
private void when(final boolean clause) {
Condition.where(clause)
.then(thenResponse)
.otherwise(otherwiseResponse);
}
private void assertThatBothResponsesRun() { private void assertThatBothResponsesRun() {
assertThatTheThenResponseRan(); assertThatTheThenResponseRan();
assertThatTheOtherwiseResponseRan(); assertThatTheOtherwiseResponseRan();
@ -271,11 +258,29 @@ public class ConditionalTest {
assertThatTheOtherwiseResponseDidNotRun(); assertThatTheOtherwiseResponseDidNotRun();
} }
private void when(final boolean firstClause, final boolean secondClause) { private void when(final boolean clause) {
Condition.where(clause)
.then(thenResponse)
.otherwise(otherwiseResponse);
}
private void when(
final boolean firstClause,
final boolean secondClause
) {
Condition.where(firstClause) Condition.where(firstClause)
.and(secondClause) .and(secondClause)
.then(thenResponse) .then(thenResponse)
.otherwise(otherwiseResponse); .otherwise(otherwiseResponse);
} }
private void whenOr(
final boolean firstClause,
final boolean secondClause
) {
Condition.where(firstClause)
.or(secondClause)
.then(thenResponse)
.otherwise(otherwiseResponse);
}
} }