diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 87cdf99..289750b 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -138,7 +138,7 @@ public class TasksFrame extends JFrame { }); } - private String reverse(String text) { + public String reverse(String text) { StringBuilder reversed = new StringBuilder(); for (int i = text.length() - 1; i >= 0; i--) { reversed.append(text.charAt(i)); diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index 70e10c3..dee0bbb 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -249,6 +249,17 @@ class TasksFrameTest { double c = tasksFrame.kreisUmfang(0); assertEquals(0, c); } + + @Test + void test_reverse(){ + TasksFrame tasksFrame = new TasksFrame(); + String text1 = tasksFrame.reverse("dania"); + assertEquals("ainad", text1); + String text2 = tasksFrame.reverse("commit"); + assertEquals("timmoc", text2); + String text3 = tasksFrame.reverse("morgen"); + assertEquals("negrom", text3); + } }