diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index d9a315d..e9f028c 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -146,7 +146,7 @@ public class TasksFrame extends JFrame { }); } - private double kreisUmfang(double radius) { + public double kreisUmfang(double radius) { double result = 2 * Math.PI * radius; double roundOff = Math.round(result * 100.0) / 100.0; diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index e12f916..70e10c3 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -238,6 +238,17 @@ class TasksFrameTest { double c = tasksFrame.average(0, 12, 38); assertEquals(16.67, c); } + + @Test + void test_kreisUmfang(){ + TasksFrame tasksFrame = new TasksFrame(); + double a = tasksFrame.kreisUmfang(10); + assertEquals(62.83, a); + double b = tasksFrame.kreisUmfang(28); + assertEquals(175.93, b); + double c = tasksFrame.kreisUmfang(0); + assertEquals(0, c); + } }