@ -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;
@ -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);