added Test Method replace in TextTest.java
This commit is contained in:
parent
549444b63c
commit
0060da1f50
|
@ -31,6 +31,17 @@ public class TextTest {
|
||||||
Assertions.assertEquals(4, txt.getText().size());
|
Assertions.assertEquals(4, txt.getText().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void replace() {
|
||||||
|
Assertions.assertEquals(true, txt.add("Das ist der erste Beispiel Text."));
|
||||||
|
Assertions.assertEquals(true, txt.add("Das ist der zweite Beispiel Text."));
|
||||||
|
Assertions.assertEquals(false, txt.replace(3, "alt", "neu"));
|
||||||
|
Assertions.assertEquals(true, txt.replace(1, "erste", "zweite"));
|
||||||
|
Assertions.assertEquals(true, txt.replace("zweite", "erste"));
|
||||||
|
Assertions.assertEquals("Das ist der zweite Beispiel Text.", txt.getText().get(0));
|
||||||
|
Assertions.assertEquals("Das ist der erste Beispiel Text.", txt.getText().get(1));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test methode for Index method
|
* Test methode for Index method
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue