diff --git a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetLastElementTest.java b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetLastElementTest.java index 4e014ab..236b6bc 100644 --- a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetLastElementTest.java +++ b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetLastElementTest.java @@ -11,7 +11,7 @@ public class GetLastElementTest { @Test public void test1() { // given - String expected = "Dog"; + String expected = "Get"; String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy", expected}; test(expected, input); } @@ -19,7 +19,7 @@ public void test1() { @Test public void test2() { // given - String expected = "Lazy"; + String expected = "This"; String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The", expected}; test(expected, input); } @@ -28,7 +28,7 @@ public void test2() { @Test public void test3() { // given - String expected = "The"; + String expected = "Off"; String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", expected}; test(expected, input); } @@ -37,7 +37,7 @@ public void test3() { @Test public void test4() { // given - String expected = "Over"; + String expected = "My"; String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", expected}; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetMiddleElementTest.java b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetMiddleElementTest.java index 5ca0d43..265bc04 100644 --- a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetMiddleElementTest.java +++ b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/GetMiddleElementTest.java @@ -8,7 +8,7 @@ public class GetMiddleElementTest { @Test public void test1() { // given - String expected = "Quick"; + String expected = "Get"; String[] input = {"The", expected, "Brown"}; test(expected, input); @@ -17,7 +17,7 @@ public void test1() { @Test public void test2() { // given - String expected = "Brown"; + String expected = "This"; String[] input = {"The", "Quick", expected, "Fox", "Jumps"}; test(expected, input); @@ -26,7 +26,7 @@ public void test2() { @Test public void test3() { // given - String expected = "Fox"; + String expected = "Off"; String[] input = {"The", "Quick", "Brown", expected, "Jumps", "Over", "The"}; test(expected, input); } @@ -34,7 +34,7 @@ public void test3() { @Test public void test4() { // given - String expected = "Jumps"; + String expected = "My"; String[] input = {"The", "Quick", "Brown", "Fox", expected, "Over", "The", "Lazy", "Dog"}; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveLastElementTest.java b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveLastElementTest.java index f7163a6..11bc644 100644 --- a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveLastElementTest.java +++ b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveLastElementTest.java @@ -11,8 +11,8 @@ public class RemoveLastElementTest { @Test public void test1() { // given - String[] expected = {"The", "Quick"}; - String[] input = {"The", "Quick", "Brown"}; + String[] expected = {"Get", "Quick"}; + String[] input = {"Get", "Quick", "Brown"}; test(expected, input); } @@ -20,16 +20,16 @@ public void test1() { @Test public void test2() { // given - String[] expected = {"The", "Quick", "Brown", "Fox"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps"}; + String[] expected = {"This", "Quick", "Brown", "Fox"}; + String[] input = {"This", "Quick", "Brown", "Fox", "Jumps"}; test(expected, input); } @Test public void test3() { // given - String[] expected = {"The", "Quick", "Brown", "Fox", "Jumps", "Over"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The"}; + String[] expected = {"Off", "Quick", "Brown", "Fox", "Jumps", "Over"}; + String[] input = {"Off", "Quick", "Brown", "Fox", "Jumps", "Over", "The"}; test(expected, input); } @@ -37,8 +37,8 @@ public void test3() { @Test public void test4() { // given - String[] expected = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy", "Dog"}; + String[] expected = {"My", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy"}; + String[] input = {"My", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy", "Dog"}; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveMiddleElementTest.java b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveMiddleElementTest.java index b17a502..344f827 100644 --- a/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveMiddleElementTest.java +++ b/src/test/java/rocks/zipcode/quiz4/arrays/arrayutils/RemoveMiddleElementTest.java @@ -8,8 +8,8 @@ public class RemoveMiddleElementTest { @Test public void test1() { // given - String[] expected = {"The", "Brown"}; - String[] input = {"The", "Quick", "Brown"}; + String[] expected = {"Get", "This"}; + String[] input = {"Get", "Quick", "This"}; test(expected, input); } @@ -17,16 +17,16 @@ public void test1() { @Test public void test2() { // given - String[] expected = {"The", "Quick", "Fox", "Jumps"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps"}; + String[] expected = {"Get", "This", "Off", "My"}; + String[] input = {"Get", "This", "Brown", "Off", "My"}; test(expected, input); } @Test public void test3() { // given - String[] expected = {"The", "Quick", "Brown", "Jumps", "Over", "The"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The"}; + String[] expected = {"Get", "This", "Off", "Fox", "My", "Plate"}; + String[] input = {"Get", "This", "Off", "Fox", "Of", "My", "Plate"}; test(expected, input); } @@ -34,8 +34,8 @@ public void test3() { @Test public void test4() { // given - String[] expected = {"The", "Quick", "Brown", "Fox", "Over", "The", "Lazy", "Dog"}; - String[] input = {"The", "Quick", "Brown", "Fox", "Jumps", "Over", "The", "Lazy", "Dog"}; + String[] expected = {"Get", "This", "Off", "Of", "My", "Damn", "Errand", "List"}; + String[] input = {"Get", "This", "Off", "Of", "Jumps", "My", "Damn", "Errand", "List"}; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/collections/food/GetAllSpicesTest.java b/src/test/java/rocks/zipcode/quiz4/collections/food/GetAllSpicesTest.java index fbfae0c..d9ea200 100644 --- a/src/test/java/rocks/zipcode/quiz4/collections/food/GetAllSpicesTest.java +++ b/src/test/java/rocks/zipcode/quiz4/collections/food/GetAllSpicesTest.java @@ -31,19 +31,25 @@ private void test(List expected) { @Test public void test1() { // given - test(Arrays.asList((Spice) new Curry())); + test(Arrays.asList( + (Spice) new Curry(), + (Spice) new Curry())); } @Test public void test2() { // given - test(Arrays.asList((Spice) new Ginger())); + test(Arrays.asList( + (Spice) new Ginger(), + (Spice) new Ginger())); } @Test public void test3() { // given - test(Arrays.asList((Spice) new Pepper())); + test(Arrays.asList( + (Spice) new Pepper(), + (Spice) new Pepper())); } @Test @@ -52,6 +58,7 @@ public void test4() { test(Arrays.asList( (Spice) new Pepper(), (Spice) new Ginger(), + (Spice) new Ginger(), (Spice) new Curry())); } @@ -62,6 +69,7 @@ public void test5() { (Spice) new Pepper(), (Spice) new Pepper(), (Spice) new Ginger(), + (Spice) new Curry(), (Spice) new Curry())); } @@ -72,6 +80,8 @@ public void test6() { test(Arrays.asList( (Spice) new Pepper(), (Spice) new Pepper(), + (Spice) new Pepper(), + (Spice) new Ginger(), (Spice) new Ginger(), (Spice) new Ginger(), (Spice) new Curry())); diff --git a/src/test/java/rocks/zipcode/quiz4/collections/food/GetSpiceCountTest.java b/src/test/java/rocks/zipcode/quiz4/collections/food/GetSpiceCountTest.java index 3ec7263..ab47b39 100644 --- a/src/test/java/rocks/zipcode/quiz4/collections/food/GetSpiceCountTest.java +++ b/src/test/java/rocks/zipcode/quiz4/collections/food/GetSpiceCountTest.java @@ -43,32 +43,32 @@ private void test(Integer amountOfIngredients, Supplier ingredientSupplier) { @Test public void test1() { - test(5, Pepper::new); + test(50, Pepper::new); } @Test public void test2() { - test(10, Pepper::new); + test(100, Pepper::new); } @Test public void test3() { - test(3, Curry::new); + test(30, Curry::new); } @Test public void test4() { - test(6, Curry::new); + test(60, Curry::new); } @Test public void test5() { - test(2, Ginger::new); + test(20, Ginger::new); } @Test public void test6() { - test(4, Ginger::new); + test(40, Ginger::new); } } diff --git a/src/test/java/rocks/zipcode/quiz4/collections/wordcounter/GetWordCountMapTest.java b/src/test/java/rocks/zipcode/quiz4/collections/wordcounter/GetWordCountMapTest.java index 1f9697e..06b9652 100644 --- a/src/test/java/rocks/zipcode/quiz4/collections/wordcounter/GetWordCountMapTest.java +++ b/src/test/java/rocks/zipcode/quiz4/collections/wordcounter/GetWordCountMapTest.java @@ -10,12 +10,12 @@ public class GetWordCountMapTest { @Test public void test1() { // given - WordCounter wordCounter = new WordCounter("Hey"); + WordCounter wordCounter = new WordCounter("Get"); Integer expected = 1; // when Map map = wordCounter.getWordCountMap(); - Integer actual = map.get("Hey"); + Integer actual = map.get("Get"); // then Assert.assertEquals(expected, actual); @@ -24,12 +24,12 @@ public void test1() { @Test public void test2() { // given - WordCounter wordCounter = new WordCounter("Hey", "Hey"); + WordCounter wordCounter = new WordCounter("Get", "This"); Integer expected = 2; // when Map map = wordCounter.getWordCountMap(); - Integer actual = map.get("Hey"); + Integer actual = map.get("Get"); // then Assert.assertEquals(expected, actual); @@ -38,14 +38,14 @@ public void test2() { @Test public void test3() { // given - WordCounter wordCounter = new WordCounter("Hey", "Hey", "Hello"); + WordCounter wordCounter = new WordCounter("Get", "Get", "This"); Integer expectedHey = 2; Integer expectedHello = 1; // when Map map = wordCounter.getWordCountMap(); - Integer actualHey = map.get("Hey"); - Integer actualHello = map.get("Hello"); + Integer actualHey = map.get("Get"); + Integer actualHello = map.get("This"); // then Assert.assertEquals(expectedHey, actualHey); @@ -56,14 +56,14 @@ public void test3() { @Test public void test4() { // given - WordCounter wordCounter = new WordCounter("Hey", "Hey", "Hello", "Hello", "Hello"); + WordCounter wordCounter = new WordCounter("Get", "Get", "This", "This", "This"); Integer expectedHey = 2; Integer expectedHello = 3; // when Map map = wordCounter.getWordCountMap(); - Integer actualHey = map.get("Hey"); - Integer actualHello = map.get("Hello"); + Integer actualHey = map.get("Get"); + Integer actualHello = map.get("This"); // then Assert.assertEquals(expectedHey, actualHey); diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/AddTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/AddTest.java index 1837cb9..b3355f9 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/AddTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/AddTest.java @@ -11,31 +11,31 @@ public class AddTest { @Test public void test1() { // given - test(99.0, 10.5, 88.5); + test(100.0, 50.0, 50.0); } @Test public void test2() { // given - test(40.12, 19.93, 20.19); + test(150.0, 50.0, 150.0); } @Test public void test3() { // given - test(39.94, 19.94, 20.00); + test(50.0, 25.0, 25.0); } @Test public void test4() { // given - test(100.00, 50.0, 50.0); + test(75.0, 25.0, 50.0); } @Test public void test5() { // given - test(22.10, 7.06, 15.04); + test(25.0, 12.5, 12.5); } private void test(Double expected, Double input1, Double input2) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/DivideTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/DivideTest.java index fbcaead..02c589f 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/DivideTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/DivideTest.java @@ -11,31 +11,31 @@ public class DivideTest { @Test public void test1() { // given - test(12.0, 144.0, 12.0); + test(1.0, 100.0, 100.0); } @Test public void test2() { // given - test(5.0, 60.0, 12.0); + test(2.0, 100.0, 50.0); } @Test public void test3() { // given - test(6.0, 36.0, 6.0); + test(4.0, 100.0, 25.0); } @Test public void test4() { // given - test(12.6, 63.0, 5.0); + test(8.0, 100.0, 12.5); } @Test public void test5() { // given - test(8.0, 72.0, 9.0); + test(16.0, 100.0, 6.25); } private void test(Double expected, Double input1, Double input2) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootTest.java index 9954061..50f39e3 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootTest.java @@ -7,31 +7,31 @@ public class SquareRootTest { @Test public void test1() { // given - test(8.0, 64.0); + test(1.0, 1.0); } @Test public void test2() { // given - test(438.0, 191844.0); + test(2.0, 4.0); } @Test public void test3() { // given - test(12.0, 144.0); + test(3.0, 9.0); } @Test public void test4() { // given - test(864.0, 746496.0); + test(4.0, 16.0); } @Test public void test5() { // given - test(6.0, 36.0); + test(5.0, 25.0); } private void test(Double expected, Double input) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootsTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootsTest.java index 0b1619d..8754db6 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootsTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareRootsTest.java @@ -12,31 +12,31 @@ public class SquareRootsTest { @Test public void test1() { // given - test(new Double[]{8.0, 9.0, 10.0, 3.0}, 64.0, 81.0, 100.0, 9.0); + test(new Double[]{1.0, 1.0, 1.0}, 1.0,1.0,1.0); } @Test public void test2() { // given - test(new Double[]{864.0, 3.0, 4.0}, 746496.0, 9.0, 16.0); + test(new Double[]{1.0,1.0,3.0}, 1.0, 1.0, 9.0); } @Test public void test3() { // given - test(new Double[]{12.0, 438.0, 9.0}, 144.0, 191844.0, 81.0); + test(new Double[]{1.0, 2.0, 3.0}, 1.0, 4.0, 9.0); } @Test public void test4() { // given - test(new Double[]{6.0, 8.0, 12.0}, 36.0, 64.0, 144.0); + test(new Double[]{2.0, 3.0, 4.0}, 4.0, 9.0, 16.0); } @Test public void test5() { // given - test(new Double[]{6.0, 12.0, 9.0}, 36.0, 144.0, 81.0); + test(new Double[]{5.0, 6.0, 7.0}, 25.0, 36.0, 49.0); } private void test(Double[] expected, Double... inputArray) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareTest.java index 47baaa8..c341d35 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquareTest.java @@ -11,31 +11,31 @@ public class SquareTest { @Test public void test1() { // given - test(1069.29, 32.70); + test(1.0, 1.0); } @Test public void test2() { // given - test(476003.4049, 689.93); + test(4.0, 2.0); } @Test public void test3() { // given - test(36.0, 6.0); + test(9.0, 3.0); } @Test public void test4() { // given - test(64.0, 8.0); + test(16.0, 4.0); } @Test public void test5() { // given - test(321489.0, 567.0); + test(25.0, 5.0); } private void test(Double expected, Double input) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquaresTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquaresTest.java index b77a6ed..b876fde 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquaresTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SquaresTest.java @@ -11,31 +11,31 @@ public class SquaresTest { @Test public void test1() { // given - test(new Double[]{4.0,16.0, 144.0}, 2.0,4.0,12.0); + test(new Double[]{1.0,1.0,1.0}, 1.0,1.0,1.0); } @Test public void test2() { // given - test(new Double[]{100.00, 49.0, 64.0, 36.0},10.0, 7.0, 8.0, 6.0); + test(new Double[]{1.0,1.0,4.0},1.0,1.0,2.0); } @Test public void test3() { // given - test(new Double[]{9.0, 25.0, 121.0, 169.0}, 3.0, 5.0, 11.0, 13.0); + test(new Double[]{1.0,4.0,9.0}, 1.0,2.0,3.0); } @Test public void test4() { // given - test(new Double[]{16.0, 9.0, 64.0, 81.0}, 4.0, 3.0, 8.0, 9.0); + test(new Double[]{9.0, 16.0, 25.0}, 3.0, 4.0, 5.0); } @Test public void test5() { // given - test(new Double[]{4.0, 25.0, 81.0}, 2.0, 5.0, 9.0); + test(new Double[]{25.0, 36.0, 49.0}, 5.0,6.0,7.0); } private void test(Double[] expected, Double... inputArray) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SubtractTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SubtractTest.java index 46a3d72..e1b8089 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SubtractTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/calculator/SubtractTest.java @@ -11,31 +11,31 @@ public class SubtractTest { @Test public void test1() { // given - test(5.0, 10.0, 5.0); + test(0.0, 1.0, 1.0); } @Test public void test2() { // given - test(150.0, 250.0, 100.0); + test(1.0, 2.0, 1.0); } @Test public void test3() { // given - test(762.0, 862.0, 100.0); + test(1.5, 2.5, 1.0); } @Test public void test4() { // given - test(-899.999, -999.999, -100.0); + test(-1.0, 0.0, 1.0); } @Test public void test5() { // given - test(-10.0, -5.0, 5.0); + test(-1.5, -2.0, -0.5); } private void test(Double expected, Double input1, Double input2) { diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/CapitalizeMiddleCharacterTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/CapitalizeMiddleCharacterTest.java index 2fcaafe..bd12735 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/CapitalizeMiddleCharacterTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/CapitalizeMiddleCharacterTest.java @@ -8,16 +8,16 @@ public class CapitalizeMiddleCharacterTest { @Test public void test1() { // given - String input = "o"; - String expected = "O"; + String input = "a"; + String expected = "A"; test(expected, input); } @Test public void test2() { // given - String input = "ooo"; - String expected = "oOo"; + String input = "aaa"; + String expected = "aAa"; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/GetMiddleCharacterTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/GetMiddleCharacterTest.java index b5acf51..ebe1610 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/GetMiddleCharacterTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/GetMiddleCharacterTest.java @@ -8,8 +8,8 @@ public class GetMiddleCharacterTest { @Test public void test1() { // given - String input = "joint"; - Character expected = 'i'; + String input = "jerkk"; + Character expected = 'r'; test(expected, input); } @@ -17,8 +17,8 @@ public void test1() { @Test public void test2() { // given - String input = "burnt"; - Character expected = 'r'; + String input = "color"; + Character expected = 'l'; test(expected, input); } @@ -26,16 +26,16 @@ public void test2() { @Test public void test3() { // given - String input = "bang!"; - Character expected = 'n'; + String input = "bark!"; + Character expected = 'r'; test(expected, input); } @Test public void test4() { // given - String input = "bang!"; - Character expected = 'n'; + String input = "park!"; + Character expected = 'r'; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/HasDuplicateConsecutiveCharactersTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/HasDuplicateConsecutiveCharactersTest.java index b57407a..f8d240e 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/HasDuplicateConsecutiveCharactersTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/HasDuplicateConsecutiveCharactersTest.java @@ -7,25 +7,25 @@ public class HasDuplicateConsecutiveCharactersTest { @Test public void test1() { - String input = "Happy"; + String input = "Fappy"; Assert.assertTrue(StringUtils.hasDuplicateConsecutiveCharacters(input)); } @Test public void test2() { - String input = "Fool"; + String input = "Cool"; Assert.assertTrue(StringUtils.hasDuplicateConsecutiveCharacters(input)); } @Test public void test3() { - String input = "George"; + String input = "Aeorge"; Assert.assertFalse(StringUtils.hasDuplicateConsecutiveCharacters(input)); } @Test public void test4() { - String input = "False"; + String input = "Talse"; Assert.assertFalse(StringUtils.hasDuplicateConsecutiveCharacters(input)); } } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/InvertCasingTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/InvertCasingTest.java index e93cea7..e6a764b 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/InvertCasingTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/InvertCasingTest.java @@ -8,42 +8,42 @@ public class InvertCasingTest { @Test public void test0() { - String input = "a"; - String expected = "A"; + String input = "A"; + String expected = "a"; Assert.assertEquals(expected, invertCasing(input)); } @Test public void test1() { - String input = "Z"; - String expected = "z"; + String input = "z"; + String expected = "Z"; Assert.assertEquals(expected, invertCasing(input)); } @Test public void test2() { - String expected = "This one is kind of tricky!"; + String expected = "Blah Blah Blah"; Assert.assertEquals(expected, invertCasing(invertCasing(expected))); } @Test public void test3() { - String input = "iNcReAsInG"; - String expected = "InCrEaSiNg"; + String input = "InCrEaSiNg"; + String expected = "iNcReAsInG"; Assert.assertEquals(expected, invertCasing(input)); } @Test public void test4() { - String input = "No Big Deal!"; - String expected = "nO bIG dEAL!"; + String input = "nO bIG dEAL!"; + String expected = "No Big Deal!"; Assert.assertEquals(expected, invertCasing(input)); } @Test public void test5() { - String expected = "#^@!&*$(%$"; + String expected = "#^@!&*$ (%$"; Assert.assertEquals(expected, invertCasing(expected)); } } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramNegativeTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramNegativeTest.java index a910c11..38df671 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramNegativeTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramNegativeTest.java @@ -10,44 +10,44 @@ public class IsogramNegativeTest { @Test public void test1() { - String input = "XX"; + String input = "AA"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test2() { - String input = "XXX"; + String input = "AAA"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test3() { - String input = "AA"; + String input = "ZZ"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test4() { - String input = "AAA"; + String input = "ZZZ"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test5() { - String input = "Here"; + String input = "Bere"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test6() { - String input = "Teared"; + String input = "Meared"; Assert.assertFalse(StringUtils.isIsogram(input)); } @Test public void test7() { - String input = "Brown Fox"; + String input = "Prown Pox"; Assert.assertFalse(StringUtils.isIsogram(input)); } } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramPositiveTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramPositiveTest.java index 78765f8..6501077 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramPositiveTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/IsogramPositiveTest.java @@ -7,32 +7,32 @@ public class IsogramPositiveTest { @Test public void test1() { - String input = "Jump"; + String input = "Lump"; Assert.assertTrue(StringUtils.isIsogram(input)); } @Test public void test2() { - String input = "Jj"; + String input = "Lj"; Assert.assertTrue(StringUtils.isIsogram(input)); } @Test public void test3() { - String input = "Jj0Oo"; + String input = "Lj0Oo"; Assert.assertTrue(StringUtils.isIsogram(input)); } @Test public void test4() { - String input = "The Quick"; + String input = "Lhe Quick"; Assert.assertTrue(StringUtils.isIsogram(input)); } @Test public void test5() { - String input = "Brown"; + String input = "Lrown"; Assert.assertTrue(StringUtils.isIsogram(input)); } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/LowerCaseMiddleCharacterTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/LowerCaseMiddleCharacterTest.java index 016a236..e430c20 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/LowerCaseMiddleCharacterTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/LowerCaseMiddleCharacterTest.java @@ -8,32 +8,32 @@ public class LowerCaseMiddleCharacterTest { @Test public void test1() { // given - String input = "O"; - String expected = "o"; + String input = "A"; + String expected = "a"; test(expected, input); } @Test public void test2() { // given - String input = "OOO"; - String expected = "OoO"; + String input = "AAA"; + String expected = "AaA"; test(expected, input); } @Test public void test3() { // given - String input = "APPLE"; - String expected = "APpLE"; + String input = "ZPPLE"; + String expected = "ZPpLE"; test(expected, input); } @Test public void test4() { // given - String input = "Waffle Sauces"; - String expected = "Waffle Sauces"; + String input = "Zaffle Sauces"; + String expected = "Zaffle Sauces"; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/RemoveDuplicateConsecutiveCharactersTest.java b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/RemoveDuplicateConsecutiveCharactersTest.java index 626aafe..78ea823 100644 --- a/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/RemoveDuplicateConsecutiveCharactersTest.java +++ b/src/test/java/rocks/zipcode/quiz4/fundamentals/stringutils/RemoveDuplicateConsecutiveCharactersTest.java @@ -8,38 +8,38 @@ public class RemoveDuplicateConsecutiveCharactersTest { @Test public void test1() { // given - String input = "Fool"; - String expected = "Fl"; + String input = "Zool"; + String expected = "Zl"; test(expected, input); } @Test public void test2() { // given - String input = "Mississippi"; - String expected = "Miiii"; + String input = "Zississippi"; + String expected = "Ziiii"; test(expected, input); } @Test public void test3() { // given - String input = "Fleet"; - String expected = "Flt"; + String input = "Zleet"; + String expected = "Zlt"; test(expected, input); } @Test public void test4() { // given - String input = "Independence"; + String input = "Zndependence"; String expected = input; test(expected, input); } @Test public void test5() { // given - String input = "Integer"; + String input = "Znteger"; String expected = input; test(expected, input); } diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/account/AccountSetIdTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/account/AccountSetIdTest.java index 24b4c6c..af8c0aa 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/account/AccountSetIdTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/account/AccountSetIdTest.java @@ -18,21 +18,21 @@ private void test(Long expectedId) { @Test public void test1() { - test(0L); + test(10L); } @Test public void test2() { - test(10L); + test(110L); } @Test public void test3() { - test(Long.MAX_VALUE); + test(Long.MAX_VALUE-1); } @Test public void test4() { - test(Long.MIN_VALUE); + test(Long.MIN_VALUE+1); } } diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/bank/RemoveBankAccountByIndexTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/bank/RemoveBankAccountByIndexTest.java index 7398c9b..09b31a2 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/bank/RemoveBankAccountByIndexTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/bank/RemoveBankAccountByIndexTest.java @@ -10,15 +10,30 @@ public class RemoveBankAccountByIndexTest { public void test1() { // given Bank bank = new Bank(); - BankAccount bankAccount = new BankAccount(); - bank.addBankAccount(bankAccount); - Assert.assertTrue(bank.containsBankAccount(bankAccount)); + BankAccount bankAccount1 = new BankAccount(); + BankAccount bankAccount2 = new BankAccount(); + BankAccount bankAccount3= new BankAccount(); + BankAccount bankAccount4 = new BankAccount(); + + bank.addBankAccount(bankAccount1); + bank.addBankAccount(bankAccount2); + bank.addBankAccount(bankAccount3); + bank.addBankAccount(bankAccount4); + + + Assert.assertTrue(bank.containsBankAccount(bankAccount1)); + Assert.assertTrue(bank.containsBankAccount(bankAccount2)); + Assert.assertTrue(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); // when bank.removeBankAccountByIndex(0); // then - Assert.assertFalse(bank.containsBankAccount(bankAccount)); + Assert.assertFalse(bank.containsBankAccount(bankAccount1)); + Assert.assertTrue(bank.containsBankAccount(bankAccount2)); + Assert.assertTrue(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); } @Test @@ -27,12 +42,19 @@ public void test2() { Bank bank = new Bank(); BankAccount bankAccount1 = new BankAccount(); BankAccount bankAccount2 = new BankAccount(); + BankAccount bankAccount3= new BankAccount(); + BankAccount bankAccount4 = new BankAccount(); bank.addBankAccount(bankAccount1); bank.addBankAccount(bankAccount2); + bank.addBankAccount(bankAccount3); + bank.addBankAccount(bankAccount4); + Assert.assertTrue(bank.containsBankAccount(bankAccount1)); Assert.assertTrue(bank.containsBankAccount(bankAccount2)); + Assert.assertTrue(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); // when bank.removeBankAccountByIndex(1); @@ -40,9 +62,10 @@ public void test2() { // then Assert.assertTrue(bank.containsBankAccount(bankAccount1)); Assert.assertFalse(bank.containsBankAccount(bankAccount2)); + Assert.assertTrue(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); } - @Test public void test3() { // given @@ -50,14 +73,18 @@ public void test3() { BankAccount bankAccount1 = new BankAccount(); BankAccount bankAccount2 = new BankAccount(); BankAccount bankAccount3= new BankAccount(); + BankAccount bankAccount4 = new BankAccount(); bank.addBankAccount(bankAccount1); bank.addBankAccount(bankAccount2); bank.addBankAccount(bankAccount3); + bank.addBankAccount(bankAccount4); + Assert.assertTrue(bank.containsBankAccount(bankAccount1)); Assert.assertTrue(bank.containsBankAccount(bankAccount2)); Assert.assertTrue(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); // when bank.removeBankAccountByIndex(2); @@ -66,5 +93,6 @@ public void test3() { Assert.assertTrue(bank.containsBankAccount(bankAccount1)); Assert.assertTrue(bank.containsBankAccount(bankAccount2)); Assert.assertFalse(bank.containsBankAccount(bankAccount3)); + Assert.assertTrue(bank.containsBankAccount(bankAccount4)); } } diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositNegativeTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositNegativeTest.java index fdabb3d..1d88bee 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositNegativeTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositNegativeTest.java @@ -12,22 +12,22 @@ public class DepositNegativeTest { @Test public void test1() { - test(100.0, 80.0); + test(1001.0, 801.0); } @Test public void test2() { - test(150.0, 70.0); + test(1501.0, 701.0); } @Test public void test3() { - test(100.0, 180.0); + test(1001.0, 1801.0); } @Test public void test4() { - test(10.0, 50.0); + test(101.0, 501.0); } public void test(Double initialBalance, Double depositAmount) { diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositPositiveTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositPositiveTest.java index 10bf550..01ee39a 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositPositiveTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/DepositPositiveTest.java @@ -12,22 +12,22 @@ public class DepositPositiveTest { @Test(expected = IllegalArgumentException.class) public void test1() { - test(100.0, -1.0); + test(1001.0, -11.0); } @Test(expected = IllegalArgumentException.class) public void test2() { - test(10.0, -50.0); + test(101.0, -501.0); } @Test(expected = IllegalArgumentException.class) public void test3() { - test(55.0, -500.0); + test(551.0, -5001.0); } @Test(expected = IllegalArgumentException.class) public void test4() { - test(78.0, -90.0); + test(781.0, -901.0); } public void test(Double initialBalance, Double depositAmount) { diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalNegativeTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalNegativeTest.java index b369f56..8a9accb 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalNegativeTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalNegativeTest.java @@ -13,27 +13,27 @@ public class WithdrawalNegativeTest { @Test(expected = IllegalArgumentException.class) public void test1() { - test(0.0, 1.0); + test(01.0, 11.0); } @Test(expected = IllegalArgumentException.class) public void test2() { - test(10.0, 50.0); + test(101.0, 501.0); } @Test(expected = IllegalArgumentException.class) public void test3() { - test(10.0, -50.0); + test(101.0, -501.0); } @Test(expected = IllegalArgumentException.class) public void test4() { - test(00.0, -50.0); + test(001.0, -501.0); } @Test(expected = IllegalArgumentException.class) public void test5() { - test(00.0, 0.01); + test(001.0, 1.00); } private void test(Double initialBalance, Double withdrawalAmount) { diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalPositiveTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalPositiveTest.java index b72a6b2..c8101f1 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalPositiveTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/bankaccount/WithdrawalPositiveTest.java @@ -12,28 +12,28 @@ public class WithdrawalPositiveTest { @Test public void test1() { - test(100.0, 80.0); + test(1001.0, 801.0); } @Test public void test2() { - test(150.0, 70.0); + test(1501.0, 701.0); } @Test public void test3() { - test(150.0, 150.0); + test(1501.0, 1501.0); } @Test public void test4() { - test(150.0, 100.0); + test(1501.0, 1001.0); } @Test public void test5() { - test(150.0, 50.0); + test(1501.0, 501.0); } public void test(Double initialBalance, Double withdrawalAmount) { diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeConstructorTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeConstructorTest.java index 67787a4..2966c4f 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeConstructorTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeConstructorTest.java @@ -57,9 +57,9 @@ public void testNullaryConstructor() { @Test public void testNonNullaryConstructor() { // given - Double expectedHourlyWage = 35.0; - Double expectedHoursWorked = 0.0; - Double expectedBalance = 15.0; + Double expectedHourlyWage = 10.0; + Double expectedHoursWorked = 10.0; + Double expectedBalance = 20.0; Double expectedBankAccountBalance = expectedBalance; Double expectedMoneyEarned = expectedHourlyWage * expectedHoursWorked; BankAccount bankAccount = new BankAccount(); diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeDepositTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeDepositTest.java index 323b3f8..a6840ec 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeDepositTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/EmployeeDepositTest.java @@ -12,27 +12,27 @@ public class EmployeeDepositTest { @Test public void test1() { - test(0.0, 10.0); + test(01.0, 101.0); } @Test public void test2() { - test(0.0, 20.0); + test(01.0, 201.0); } @Test public void test3() { - test(10.0, 100.0); + test(101.0, 1001.0); } @Test public void test4() { - test(20.0, 300.0); + test(201.0, 3001.0); } @Test public void test5() { - test(0.0, 400.0); + test(01.0, 4001.0); } diff --git a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/IncreaseHoursWorkedTest.java b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/IncreaseHoursWorkedTest.java index 2d44dd6..7b79f4b 100644 --- a/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/IncreaseHoursWorkedTest.java +++ b/src/test/java/rocks/zipcode/quiz4/objectorientation/employee/IncreaseHoursWorkedTest.java @@ -13,27 +13,27 @@ public class IncreaseHoursWorkedTest { @Test public void test1() { // given - test(0.0, 1.0); + test(01.0, 11.0); } @Test public void test2() { // given - test(0.0, 5.0); + test(01.0, 51.0); } @Test public void test4() { // given - test(1.0, 10.0); + test(11.0, 101.0); } @Test public void test5() { // given - test(2.0, 2.0); + test(21.0, 21.0); }