From 826dcc17ca1766c4ec91f5677234632efaccdea0 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 21 Apr 2017 18:37:14 +0100 Subject: [PATCH] ConditionalTest: more tests --- .../kemitix/conditional/ConditionalTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/test/java/net/kemitix/conditional/ConditionalTest.java b/src/test/java/net/kemitix/conditional/ConditionalTest.java index f249ffc..4a49fb4 100644 --- a/src/test/java/net/kemitix/conditional/ConditionalTest.java +++ b/src/test/java/net/kemitix/conditional/ConditionalTest.java @@ -166,6 +166,26 @@ public class ConditionalTest { thenNoResponseRuns(); } + @Test + public void whereTrueChainedThensBothRuns() { + //when + Condition.where(true) + .then(thenResponse) + .then(otherwiseResponse); + //then + thenBothResponsesRun(); + } + + @Test + public void whereFalseChainedThensNothingRuns() { + //when + Condition.where(false) + .then(thenResponse) + .then(otherwiseResponse); + //then + thenNoResponseRuns(); + } + private void whenOr(final boolean firstClause, final boolean secondClause) { Condition.where(firstClause) .or(secondClause)