Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon authored and Leon committed Feb 8, 2018
1 parent c1e89fd commit c38f540
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}


Expand Down Expand Up @@ -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);
}





Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand All @@ -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);
Expand Down Expand Up @@ -432,4 +438,4 @@ public void testRemoveValue2() {



}
}

0 comments on commit c38f540

Please sign in to comment.