aufgeräumt

This commit is contained in:
Johannes Theiner 2018-04-13 11:38:08 +02:00
parent 84a9c18a14
commit c438beca4c
1 changed files with 16 additions and 16 deletions

View File

@ -10,7 +10,7 @@ import static org.junit.Assert.*;
public class CharCollectionTest2 { public class CharCollectionTest2 {
CharCollection a, b, c, d; private CharCollection a, b, c, d;
@Before @Before
public void setUp() public void setUp()
@ -56,10 +56,10 @@ public class CharCollectionTest2 {
@Test @Test
public void Vergleich(){ public void Vergleich(){
assertTrue(a.equals(c)); assertEquals(a, c);
assertTrue(b.equals(new CharCollection("CCEHHHLOSU"))); assertEquals(b, new CharCollection("CCEHHHLOSU"));
assertFalse(b.equals(new CharCollection("CEHLOSU"))); assertNotEquals(b, new CharCollection("CEHLOSU"));
assertTrue(d.equals(new CharCollection(""))); assertEquals(d, new CharCollection(""));
} }
@Test @Test
@ -83,23 +83,23 @@ public class CharCollectionTest2 {
@Test @Test
public void Mindestens(){ public void Mindestens(){
assertTrue(a.moreThan(1).equals(new CharCollection("AAANN"))); assertEquals(a.moreThan(1), new CharCollection("AAANN"));
assertTrue(a.moreThan(2).equals(new CharCollection("AAA"))); assertEquals(a.moreThan(2), new CharCollection("AAA"));
assertEquals("(A, A, A)",a.moreThan(2).toString()); assertEquals("(A, A, A)",a.moreThan(2).toString());
assertTrue(b.moreThan(1).equals(new CharCollection("CCHHH"))); assertEquals(b.moreThan(1), new CharCollection("CCHHH"));
assertTrue(b.moreThan(3).equals(new CharCollection(""))); assertEquals(b.moreThan(3), new CharCollection(""));
assertEquals("()",b.moreThan(3).toString()); assertEquals("()",b.moreThan(3).toString());
} }
@Test @Test
public void Differenz(){ public void Differenz(){
assertTrue(a.except(new CharCollection("NASE")).equals(new CharCollection("AAN"))); assertEquals(a.except(new CharCollection("NASE")), new CharCollection("AAN"));
assertTrue(a.except(new CharCollection("KIWI")).equals(new CharCollection("ANANAS"))); assertEquals(a.except(new CharCollection("KIWI")), new CharCollection("ANANAS"));
assertTrue(a.except(new CharCollection()).equals(new CharCollection("ANANAS"))); assertEquals(a.except(new CharCollection()), new CharCollection("ANANAS"));
assertTrue(a.except(new CharCollection("ANANAS")).equals(new CharCollection())); assertEquals(a.except(new CharCollection("ANANAS")), new CharCollection());
assertTrue(b.except(new CharCollection("CHHO")).equals(new CharCollection("SCHULE"))); assertEquals(b.except(new CharCollection("CHHO")), new CharCollection("SCHULE"));
assertTrue(c.except(new CharCollection("HOSIANNA")).equals(new CharCollection('A'))); assertEquals(c.except(new CharCollection("HOSIANNA")), new CharCollection('A'));
assertTrue(d.except(new CharCollection("ABCD")).equals(new CharCollection())); assertEquals(d.except(new CharCollection("ABCD")), new CharCollection());
} }
@Test @Test