Leon před 6 roky
rodič
revize
c38f54031e

+ 16
- 10
src/test/java/com/zipcodewilmington/StringArrayUtilsTest.java Zobrazit soubor

@@ -233,7 +233,7 @@ public class StringArrayUtilsTest {
233 233
 
234 234
     @Test
235 235
     public void testIsPalindromic2() {
236
-        String[] array = {"Is this a plaindrome?", "This is a plaindrome", "Is this a palindrome?"};
236
+        String[] array = {"Is this a palindrome?", "This is a palindrome", "Is this a palindrome?"};
237 237
         boolean outcome = StringArrayUtils.isPalindromic(array);
238 238
         Assert.assertTrue(outcome);
239 239
     }
@@ -243,7 +243,7 @@ public class StringArrayUtilsTest {
243 243
     public void testIsPalindromic3() {
244 244
         String[] array = {"Is this a plaindrome?", "This is not a plaindrome", "Is this a palindrome?", "This is not a palindrome"};
245 245
         boolean outcome = StringArrayUtils.isPalindromic(array);
246
-        Assert.assertTrue(outcome);
246
+        Assert.assertFalse(outcome);
247 247
     }
248 248
 
249 249
 
@@ -276,6 +276,14 @@ public class StringArrayUtilsTest {
276 276
     }
277 277
 
278 278
 
279
+    @Test
280
+    public void testIsPangramic4() {
281
+        String[] array = {"a", "b", "c", "d"};
282
+        boolean outcome = StringArrayUtils.isPangramic(array);
283
+        Assert.assertFalse(outcome);
284
+    }
285
+
286
+
279 287
 
280 288
 
281 289
 
@@ -343,10 +351,9 @@ public class StringArrayUtilsTest {
343 351
     }
344 352
 
345 353
 
346
-
347 354
     @Test
348 355
     public void testRemoveConsecutiveDuplicates3() {
349
-        String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "bbb", "bbb", "aba", "bbb"};
356
+        String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "aba", "bbb"};
350 357
         String[] actual = StringArrayUtils.removeConsecutiveDuplicates(array);
351 358
         String[] expected = {"aba", "baa", "bab", "bba", "zzz", "bba", "aba", "bbb"};
352 359
         Assert.assertEquals(actual, expected);
@@ -364,18 +371,17 @@ public class StringArrayUtilsTest {
364 371
 
365 372
     @Test
366 373
     public void testRemovePackDuplicates1() {
367
-        String[] array = {"a", "a", "a", "a", "b", "c", "c", "a", "a", "d"};
368
-        String[] expected = {"aaa", "b", "cc", "aa", "d", "eee"};
374
+        String[] array = {"a", "a", "a", "b", "c", "c", "a", "a", "d"};
375
+        String[] expected = {"aaa", "b", "cc", "aa", "d"};
369 376
         String[] actual = StringArrayUtils.packConsecutiveDuplicates(array);
370 377
         Assert.assertEquals(expected, actual);
371 378
     }
372 379
 
373 380
 
374
-
375 381
     @Test
376 382
     public void testRemovePackDuplicates2() {
377 383
         String[] array = {"t", "t", "q", "a", "a", "a", "b", "c", "c", "a", "a", "d", "e", "e", "e"};
378
-        String[] expected = {"tt", "q", "aaa", "cc", "aa", "d", "eee"};
384
+        String[] expected = {"tt", "q", "aaa", "b", "cc", "aa", "d", "eee"};
379 385
         String[] actual = StringArrayUtils.packConsecutiveDuplicates(array);
380 386
         Assert.assertEquals(expected, actual);
381 387
     }
@@ -399,7 +405,7 @@ public class StringArrayUtilsTest {
399 405
 
400 406
     @Test
401 407
     public void testRemoveValue() {
402
-        String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
408
+        String[] array = {"The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
403 409
         String[] expected = {"quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
404 410
         String[] actual = StringArrayUtils.removeValue(array, "The");
405 411
         Assert.assertEquals(expected, actual);
@@ -432,4 +438,4 @@ public class StringArrayUtilsTest {
432 438
 
433 439
 
434 440
 
435
-}
441
+}