From dfa6bbd0adac7a1ff4bb846b1fe6c7388586fd8f Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Thu, 9 Feb 2023 20:53:15 +0100 Subject: [PATCH] Ertraege Funktion + Test --- src/main/java/src/TasksFrame.java | 7 +++++++ src/test/java/src/TasksFrameTest.java | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 27558af..8b8e942 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -1262,6 +1262,13 @@ public class TasksFrame extends JFrame { return x; } + public int setupErtraege(int a, int b, int c) + { + int x = 0; + x = a+b+c; + return x; + } + public void setupArea() { diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java index 1d7c156..19c3292 100644 --- a/src/test/java/src/TasksFrameTest.java +++ b/src/test/java/src/TasksFrameTest.java @@ -43,6 +43,14 @@ class TasksFrameTest { int x = tasksFrame.setupAufwendungen(20000,6000,10000,4000,100); assertEquals(40100, x); } + + @Test + void ertraege() + { + TasksFrame tasksFrame = new TasksFrame(); + int x2 = tasksFrame.setupErtraege(80000,13000,4000); + assertEquals(97000, x2); + } @Test void setupPI() { TasksFrame tasksFrame = new TasksFrame();