From c438beca4c41b5c902d9872ff892b086c99c5d55 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Fri, 13 Apr 2018 11:38:08 +0200 Subject: [PATCH] =?UTF-8?q?aufger=C3=A4umt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hs/java2/tests/CharCollectionTest2.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/test/java/de/joethei/hs/java2/tests/CharCollectionTest2.java b/src/test/java/de/joethei/hs/java2/tests/CharCollectionTest2.java index 28a5c1e..4b97825 100644 --- a/src/test/java/de/joethei/hs/java2/tests/CharCollectionTest2.java +++ b/src/test/java/de/joethei/hs/java2/tests/CharCollectionTest2.java @@ -10,7 +10,7 @@ import static org.junit.Assert.*; public class CharCollectionTest2 { - CharCollection a, b, c, d; + private CharCollection a, b, c, d; @Before public void setUp() @@ -56,10 +56,10 @@ public class CharCollectionTest2 { @Test public void Vergleich(){ - assertTrue(a.equals(c)); - assertTrue(b.equals(new CharCollection("CCEHHHLOSU"))); - assertFalse(b.equals(new CharCollection("CEHLOSU"))); - assertTrue(d.equals(new CharCollection(""))); + assertEquals(a, c); + assertEquals(b, new CharCollection("CCEHHHLOSU")); + assertNotEquals(b, new CharCollection("CEHLOSU")); + assertEquals(d, new CharCollection("")); } @Test @@ -83,23 +83,23 @@ public class CharCollectionTest2 { @Test public void Mindestens(){ - assertTrue(a.moreThan(1).equals(new CharCollection("AAANN"))); - assertTrue(a.moreThan(2).equals(new CharCollection("AAA"))); + assertEquals(a.moreThan(1), new CharCollection("AAANN")); + assertEquals(a.moreThan(2), new CharCollection("AAA")); assertEquals("(A, A, A)",a.moreThan(2).toString()); - assertTrue(b.moreThan(1).equals(new CharCollection("CCHHH"))); - assertTrue(b.moreThan(3).equals(new CharCollection(""))); + assertEquals(b.moreThan(1), new CharCollection("CCHHH")); + assertEquals(b.moreThan(3), new CharCollection("")); assertEquals("()",b.moreThan(3).toString()); } @Test public void Differenz(){ - assertTrue(a.except(new CharCollection("NASE")).equals(new CharCollection("AAN"))); - assertTrue(a.except(new CharCollection("KIWI")).equals(new CharCollection("ANANAS"))); - assertTrue(a.except(new CharCollection()).equals(new CharCollection("ANANAS"))); - assertTrue(a.except(new CharCollection("ANANAS")).equals(new CharCollection())); - assertTrue(b.except(new CharCollection("CHHO")).equals(new CharCollection("SCHULE"))); - assertTrue(c.except(new CharCollection("HOSIANNA")).equals(new CharCollection('A'))); - assertTrue(d.except(new CharCollection("ABCD")).equals(new CharCollection())); + assertEquals(a.except(new CharCollection("NASE")), new CharCollection("AAN")); + assertEquals(a.except(new CharCollection("KIWI")), new CharCollection("ANANAS")); + assertEquals(a.except(new CharCollection()), new CharCollection("ANANAS")); + assertEquals(a.except(new CharCollection("ANANAS")), new CharCollection()); + assertEquals(b.except(new CharCollection("CHHO")), new CharCollection("SCHULE")); + assertEquals(c.except(new CharCollection("HOSIANNA")), new CharCollection('A')); + assertEquals(d.except(new CharCollection("ABCD")), new CharCollection()); } @Test