From dc27d21d73cf168f05dc2dd6d70ecb098e1f26c4 Mon Sep 17 00:00:00 2001 From: Abe Date: Thu, 2 Mar 2023 17:34:53 -0600 Subject: [PATCH 1/2] Complete the test class for addFive --- .../gettingstarted/GettingStartedTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/tudelft/gettingstarted/GettingStartedTest.java b/src/test/java/tudelft/gettingstarted/GettingStartedTest.java index dca51b75..b66305b5 100644 --- a/src/test/java/tudelft/gettingstarted/GettingStartedTest.java +++ b/src/test/java/tudelft/gettingstarted/GettingStartedTest.java @@ -24,4 +24,19 @@ public void addFiveTo20() { // int result = new GettingStarted().addFive(???); // Assertions.assertEquals(????,result); // } + + @Test +// Add the correct numbers + public void addFiveToZero() { + int result = new GettingStarted().addFive(0); + Assertions.assertEquals(5,result); + } + @Test +// Write this test + public void addFiveToMinusTwenty() { + int result = new GettingStarted().addFive(-20); + Assertions.assertEquals(-15,result); + + + } } From 580b951c71b35488502c47e1fdee564bdfe3e829 Mon Sep 17 00:00:00 2001 From: Abe Date: Tue, 7 Mar 2023 22:38:19 -0600 Subject: [PATCH 2/2] Removed Else --- src/main/java/tudelft/numfinder/NumFinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tudelft/numfinder/NumFinder.java b/src/main/java/tudelft/numfinder/NumFinder.java index 4577ef25..3d0cf32c 100644 --- a/src/main/java/tudelft/numfinder/NumFinder.java +++ b/src/main/java/tudelft/numfinder/NumFinder.java @@ -9,7 +9,7 @@ public void find(int[] nums) { if(n < smallest) smallest = n; - else if (n > largest) + if (n > largest) largest = n; }