From cb1f50c07248650a4202800c86c7de1bd9ff5b23 Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Thu, 12 Mar 2020 13:53:03 +0100 Subject: [PATCH 1/2] STORY-1 Add additional test for negative numbers --- src/test/java/CalculatorTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/CalculatorTest.java b/src/test/java/CalculatorTest.java index fdeab91..4724844 100644 --- a/src/test/java/CalculatorTest.java +++ b/src/test/java/CalculatorTest.java @@ -15,4 +15,9 @@ public void setUp() { public void testAdd() { assertEquals(4, calculator.add(3, 1)); } + + @Test + public void testAddNegativeNumbers() { + assertEquals(-8, calculator.add(-4, -4)); + } } From e671be16b433047884a5c27621871f2d2e878ce3 Mon Sep 17 00:00:00 2001 From: Michael Herold Date: Fri, 20 Mar 2020 08:54:47 +0100 Subject: [PATCH 2/2] STORY-1 Change test for negative numbers --- src/test/java/CalculatorTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/CalculatorTest.java b/src/test/java/CalculatorTest.java index 4724844..7b7e95c 100644 --- a/src/test/java/CalculatorTest.java +++ b/src/test/java/CalculatorTest.java @@ -18,6 +18,6 @@ public void testAdd() { @Test public void testAddNegativeNumbers() { - assertEquals(-8, calculator.add(-4, -4)); + assertEquals(Math.sqrt((1D - Math.pow(4D, 5D)) * -1D) / 4D * -Math.cos(0), calculator.add(-4, -4), 0.01D); } }