From 3416b6dd759959bc5a168a36a9fbfe2c853e3b2a Mon Sep 17 00:00:00 2001 From: 3012330 <3012330@stud.hs-mannheim.de> Date: Mon, 8 Jan 2024 19:13:20 +0100 Subject: [PATCH] =?UTF-8?q?JUnit-Tests=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spreadsheet/SpreadsheetTest.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Axel/src/de/hs_mannheim/informatik/spreadsheet/SpreadsheetTest.java diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/SpreadsheetTest.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/SpreadsheetTest.java new file mode 100644 index 0000000..412203d --- /dev/null +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/SpreadsheetTest.java @@ -0,0 +1,55 @@ +package de.hs_mannheim.informatik.spreadsheet; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class SpreadsheetTest { + + @Test + void sum() { + } + + @Test + void pro() { + } + + @Test + void min() { + } + + @Test + void max() { + } + + @Test + void mittelwert() { + } + + @Test + void calculate() { + Spreadsheet spr = new Spreadsheet(20,20); + + assertEquals(spr.calculate("20+2"), 22); + assertEquals(spr.calculate("4-3"), 1); + assertEquals(spr.calculate("3*3"), 9); + assertEquals(spr.calculate("9/3"), 3); + + + spr.put("A1", "3"); + spr.put("A2", "3"); + + assertEquals(spr.calculate("A1+20"), 23); + + assertEquals(spr.calculate("A1+A2"), 6); + assertEquals(spr.calculate("A1-A2"), 0); + assertEquals(spr.calculate("A1*A2"), 9); + assertEquals(spr.calculate("A1/A2"), 1); + } + + @Test + void rechne() { + // 1 = +, 2 = -, 3 = *, 4 = / + //assertEquals(Spreadsheet.rechne(), ); + } +} \ No newline at end of file