diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 39b80f9..0c367fd 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -130,11 +130,11 @@ public class TasksFrame extends JFrame { public int roundSum(int a, int b, int c) { - return runde10(a) + runde10(b) + runde10(c); + return round10(a) + round10(b) + round10(c); } - public int runde10(int n) { + public int round10(int n) { if (n % 10 >= 5) { return n + 10 - n % 10; } diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index ea4a96b..ca296e1 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -126,6 +126,16 @@ class TasksFrameTest { assertEquals(70, c); } + @Test + void test_roundSum(){ + TasksFrame tasksFrame = new TasksFrame(); + int a = tasksFrame.roundSum(15, 21, 12); + assertEquals(50, a); + int b = tasksFrame.roundSum(48, 25, 17); + assertEquals(100, b); + int c = tasksFrame.roundSum(13, 9, 26); + assertEquals(50, c); + } }