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

Merge pull request #636 from exercism/scrabble-score-update

scrabble-score: update to v1.0.0 of tests
FridaTveit 9 лет назад
Родитель
Сommit
0a28314542

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

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

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

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