diff --git a/confidence-core/src/test/java/org/saynotobugs/confidence/assessment/PassTest.java b/confidence-core/src/test/java/org/saynotobugs/confidence/assessment/PassTest.java index b890eaa1..c9307ce7 100644 --- a/confidence-core/src/test/java/org/saynotobugs/confidence/assessment/PassTest.java +++ b/confidence-core/src/test/java/org/saynotobugs/confidence/assessment/PassTest.java @@ -12,6 +12,17 @@ class PassTest { + @Test + void testDefaultCtor() + { + assertThat(new Pass(), + new AllOf<>( + new Satisfies<>(Assessment::isSuccess, new Text("passes")), + new Has<>(Assessment::description, new DescribesAs("")) + )); + } + + @Test void test() { @@ -21,5 +32,4 @@ void test() new Has<>(Assessment::description, new DescribesAs("pass")) )); } - } \ No newline at end of file diff --git a/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassedTest.java b/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassedTest.java index 4b71c080..1a7ac86d 100644 --- a/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassedTest.java +++ b/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassedTest.java @@ -12,9 +12,39 @@ class PassedTest { + @Test + void testWithString() + { + assertThat(new Passed("abc"), + new AllOf<>( + new Passes<>(new Pass(new Text("abc")), "both,\n" + + " passes and\n" + + " had description described as\n" + + " ----\n" + + " \"abc\"\n" + + " ----"), + new Fails(new Assessment() + { + @Override + public boolean isSuccess() + { + return true; + } + + + @Override + public org.saynotobugs.confidence.Description description() + { + return new Text("oops"); + } + }, "both,\n ... and\n had description described as\n ----\n \"oops\"\n ----"), + new Fails<>(new Fail(new Text("failed")), "both,\n failed and\n had description described as\n ----\n \"failed\"\n ----"), + new HasDescription("both,\n passes and\n has description describes as\n ----\n \"abc\"\n ----") + )); + } @Test - void test() + void testWithQuality() { assertThat(new Passed(new DescribesAs("abc")), new AllOf<>( diff --git a/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassesTest.java b/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassesTest.java index b02fd0ce..3dea3e5d 100644 --- a/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassesTest.java +++ b/confidence-test/src/test/java/org/saynotobugs/confidence/test/quality/PassesTest.java @@ -41,6 +41,22 @@ public org.saynotobugs.confidence.Description description() " ----\n" + " ----"), new Fails<>(new Quality() + { + @Override + public Assessment assessmentOf(Integer candidate) + { + return new Pass(new Text("incorrect")); + } + + + @Override + public org.saynotobugs.confidence.Description description() + { + return new Text("passes"); + } + }, + "passed 1 with description \n ----\n incorrect\n ----"), + new Fails<>(new Quality() { @Override public Assessment assessmentOf(Integer candidate)