diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 289750b..aaa9795 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -8,6 +8,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.LinkedList; +import java.lang.Character; + public class TasksFrame extends JFrame { @@ -191,8 +193,6 @@ public class TasksFrame extends JFrame { return Math.round(result * 100.0) / 100.0; } - - private void setupDurchschnitt() { JPanel jPanel = setupPanel("Durchschnitt"); @@ -247,8 +247,6 @@ public class TasksFrame extends JFrame { } - - private void setupExponent() { JPanel jPanel = setupPanel("Potenzrechner"); @@ -391,6 +389,7 @@ public class TasksFrame extends JFrame { return steuer; } + private void setupSteuer() { JPanel jPanel = setupPanel("Steuer Berechner von Kaufprodukten"); @@ -980,6 +979,13 @@ public class TasksFrame extends JFrame { jPanel.add(k); } + public int bin1(int a, int b) + { + int x = 0; + x = a*a + 2*a*b + b*b; + return x; + } + public void setupArea() { diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index dee0bbb..6b73c72 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -2,10 +2,21 @@ package src; import org.junit.jupiter.api.Test; + import static org.junit.jupiter.api.Assertions.*; class TasksFrameTest { + @Test + void bin1() { + TasksFrame tasksFrame = new TasksFrame(); + int x = tasksFrame.bin1(5, 4); + assertEquals(81, x); + int x2 = tasksFrame.bin1(7,3); + assertEquals(100,x2); + } + + @Test void setupPI() { TasksFrame tasksFrame = new TasksFrame(); @@ -37,7 +48,7 @@ class TasksFrameTest { assertEquals(273.15,x3,0.01); } - + @Test void setupSteuer19(){ TasksFrame tasksFrame = new TasksFrame();