Procházet zdrojové kódy

Merge pull request #76 from matthewmorgan/fix-word-count-test

Fix example and test to use proper casing for method names
John Ryan před 10 roky
rodič
revize
6753d9cc3e

+ 1
- 1
word-count/src/example/java/WordCount.java Zobrazit soubor

@@ -5,7 +5,7 @@ import java.util.Map;
5 5
 
6 6
 public class WordCount {
7 7
 
8
-    public Map<String, Integer> Phrase( String input ) {
8
+    public Map<String, Integer> phrase( String input ) {
9 9
         Map<String, Integer> countMap = new HashMap<String, Integer>();
10 10
         input = input.trim().toLowerCase().replaceAll("[\\W]", " ");
11 11
         final String[] tokenizedInput = input.split("\\s+");

+ 6
- 6
word-count/src/test/java/WordCountTest.java Zobrazit soubor

@@ -17,7 +17,7 @@ public class WordCountTest {
17 17
         final Map<String, Integer> expectedWordCount = new HashMap<String, Integer>();
18 18
         expectedWordCount.put("word", 1);
19 19
 
20
-        actualWordCount = wordCount.Phrase("word");
20
+        actualWordCount = wordCount.phrase("word");
21 21
         assertEquals(
22 22
             expectedWordCount, actualWordCount
23 23
         );
@@ -31,7 +31,7 @@ public class WordCountTest {
31 31
         expectedWordCount.put("of", 1);
32 32
         expectedWordCount.put("each", 1);
33 33
 
34
-        actualWordCount = wordCount.Phrase("one of each");
34
+        actualWordCount = wordCount.phrase("one of each");
35 35
         assertEquals(
36 36
             expectedWordCount, actualWordCount
37 37
         );
@@ -47,7 +47,7 @@ public class WordCountTest {
47 47
         expectedWordCount.put("red", 1);
48 48
         expectedWordCount.put("blue", 1);
49 49
 
50
-        actualWordCount = wordCount.Phrase("one fish two fish red fish blue fish");
50
+        actualWordCount = wordCount.phrase("one fish two fish red fish blue fish");
51 51
         assertEquals(
52 52
             expectedWordCount, actualWordCount
53 53
         );
@@ -63,7 +63,7 @@ public class WordCountTest {
63 63
         expectedWordCount.put("java", 1);
64 64
         expectedWordCount.put("javascript", 1);
65 65
 
66
-        actualWordCount = wordCount.Phrase("car : carpet as java : javascript!!&@$%^&");
66
+        actualWordCount = wordCount.phrase("car : carpet as java : javascript!!&@$%^&");
67 67
         assertEquals(
68 68
             expectedWordCount, actualWordCount
69 69
         );
@@ -78,7 +78,7 @@ public class WordCountTest {
78 78
         expectedWordCount.put("1", 1);
79 79
         expectedWordCount.put("2", 1);
80 80
 
81
-        actualWordCount = wordCount.Phrase("testing, 1, 2 testing");
81
+        actualWordCount = wordCount.phrase("testing, 1, 2 testing");
82 82
         assertEquals(
83 83
             expectedWordCount, actualWordCount
84 84
         );
@@ -90,7 +90,7 @@ public class WordCountTest {
90 90
         final Map<String, Integer> expectedWordCount = new HashMap<String, Integer>();
91 91
         expectedWordCount.put("go", 3);
92 92
 
93
-        actualWordCount = wordCount.Phrase("go Go GO");
93
+        actualWordCount = wordCount.phrase("go Go GO");
94 94
         assertEquals(
95 95
             expectedWordCount, actualWordCount
96 96
         );