From c38f54031eea636ac8c3007a0f78a12ecc7c43e6 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 8 Feb 2018 17:55:55 -0500 Subject: [PATCH] updated tests --- .../StringArrayUtilsTest.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java b/src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java index 4659a62..036d82c 100644 --- a/src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java +++ b/src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java @@ -233,7 +233,7 @@ public void testIsPalindromic1() { @Test public void testIsPalindromic2() { - String[] array = {"Is this a plaindrome?", "This is a plaindrome", "Is this a palindrome?"}; + String[] array = {"Is this a palindrome?", "This is a palindrome", "Is this a palindrome?"}; boolean outcome = StringArrayUtils.isPalindromic(array); Assert.assertTrue(outcome); } @@ -243,7 +243,7 @@ public void testIsPalindromic2() { public void testIsPalindromic3() { String[] array = {"Is this a plaindrome?", "This is not a plaindrome", "Is this a palindrome?", "This is not a palindrome"}; boolean outcome = StringArrayUtils.isPalindromic(array); - Assert.assertTrue(outcome); + Assert.assertFalse(outcome); } @@ -276,6 +276,14 @@ public void testIsPangramic3() { } + @Test + public void testIsPangramic4() { + String[] array = {"a", "b", "c", "d"}; + boolean outcome = StringArrayUtils.isPangramic(array); + Assert.assertFalse(outcome); + } + + @@ -343,10 +351,9 @@ public void testRemoveConsecutiveDuplicates2() { } - @Test public void testRemoveConsecutiveDuplicates3() { - String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "bbb", "bbb", "aba", "bbb"}; + String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "aba", "bbb"}; String[] actual = StringArrayUtils.removeConsecutiveDuplicates(array); String[] expected = {"aba", "baa", "bab", "bba", "zzz", "bba", "aba", "bbb"}; Assert.assertEquals(actual, expected); @@ -364,18 +371,17 @@ public void testRemoveConsecutiveDuplicates3() { @Test public void testRemovePackDuplicates1() { - String[] array = {"a", "a", "a", "a", "b", "c", "c", "a", "a", "d"}; - String[] expected = {"aaa", "b", "cc", "aa", "d", "eee"}; + String[] array = {"a", "a", "a", "b", "c", "c", "a", "a", "d"}; + String[] expected = {"aaa", "b", "cc", "aa", "d"}; String[] actual = StringArrayUtils.packConsecutiveDuplicates(array); Assert.assertEquals(expected, actual); } - @Test public void testRemovePackDuplicates2() { String[] array = {"t", "t", "q", "a", "a", "a", "b", "c", "c", "a", "a", "d", "e", "e", "e"}; - String[] expected = {"tt", "q", "aaa", "cc", "aa", "d", "eee"}; + String[] expected = {"tt", "q", "aaa", "b", "cc", "aa", "d", "eee"}; String[] actual = StringArrayUtils.packConsecutiveDuplicates(array); Assert.assertEquals(expected, actual); } @@ -399,7 +405,7 @@ public void testRemovePackDuplicates3() { @Test public void testRemoveValue() { - String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}; + String[] array = {"The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}; String[] expected = {"quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}; String[] actual = StringArrayUtils.removeValue(array, "The"); Assert.assertEquals(expected, actual); @@ -432,4 +438,4 @@ public void testRemoveValue2() { -} +} \ No newline at end of file