From 525d21cef1232f55d7c72bfd342a0c89305226b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=BCckemeyer?= <gero.lueckemeyer@hft-stuttgart.de> Date: Tue, 24 Oct 2023 12:42:47 +0000 Subject: [PATCH] added second test updated to junit5 --- .../ip2/CalculatorSecondTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/de/hftstuttgart/ip2/CalculatorSecondTest.java diff --git a/test/de/hftstuttgart/ip2/CalculatorSecondTest.java b/test/de/hftstuttgart/ip2/CalculatorSecondTest.java new file mode 100644 index 0000000..27476c6 --- /dev/null +++ b/test/de/hftstuttgart/ip2/CalculatorSecondTest.java @@ -0,0 +1,36 @@ +package de.hftstuttgart.ip2; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class CalculatorSecondTest { + + private Calculator calculator = new Calculator(); + + @Test + public void add2() throws Exception { + assertEquals(5, calculator.add(2, 3), 0.1); + } + + @Test + public void sub2() throws Exception { + assertEquals(-1, calculator.sub(2, 3), 0.1); + } + + @Test + public void mult2() throws Exception { + assertEquals(15, calculator.mult(5, 2), 0.1); + } + + @Test + public void div2() throws Exception { + assertEquals(5, calculator.div(15, 3), 0.1); + } + + @Test + public void sum2() throws Exception { + assertEquals(12, calculator.sum(3, 4, 5), 0.1); + } + +} -- GitLab