Просмотр исходного кода

scrabble-score: update to v1.0.0 of tests

Stuart Kent 9 лет назад
Родитель
Сommit
12bc03540c

+ 1
- 1
exercises/scrabble-score/src/example/java/Scrabble.java Просмотреть файл

@@ -45,7 +45,7 @@ final class Scrabble {
45 45
     }
46 46
 
47 47
     private static int getScore(String input) {
48
-        if (input == null || input.trim().isEmpty()) {
48
+        if (input.trim().isEmpty()) {
49 49
             return 0;
50 50
         }
51 51
 

+ 10
- 5
exercises/scrabble-score/src/test/java/ScrabbleScoreTest.java Просмотреть файл

@@ -7,6 +7,9 @@ import java.util.Collection;
7 7
 
8 8
 import static org.junit.Assert.assertEquals;
9 9
 
10
+/*
11
+ * version: 1.0.0
12
+ */
10 13
 @RunWith(Parameterized.class)
11 14
 public class ScrabbleScoreTest {
12 15
 
@@ -16,15 +19,17 @@ public class ScrabbleScoreTest {
16 19
     @Parameterized.Parameters(name = "{index}: expected scrabble score for \"{0}\" to be {1}")
17 20
     public static Collection<Object[]> data() {
18 21
         return Arrays.asList(new Object[][]{
19
-                {"", 0},
20
-                {" \t\n", 0},
21
-                {null, 0},
22 22
                 {"a", 1},
23
+                {"A", 1},
23 24
                 {"f", 4},
25
+                {"at", 2},
26
+                {"zoo", 12},
24 27
                 {"street", 6},
25 28
                 {"quirky", 22},
26
-                {"OXYPHENBUTAZONE", 41},
27
-                {"alacrity", 13},
29
+                {"OxyphenButazone", 41},
30
+                {"pinata", 8},
31
+                {"", 0},
32
+                {"abcdefghijklmnopqrstuvwxyz", 87},
28 33
         });
29 34
     }
30 35