Skip to content

Commit 6753d9c

Browse files
committed
Merge pull request exercism#76 from matthewmorgan/fix-word-count-test
Fix example and test to use proper casing for method names
2 parents bd4e0c3 + 7d940cf commit 6753d9c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎word-count/src/example/java/WordCount.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public class WordCount {
77

8-
public Map<String, Integer> Phrase( String input ) {
8+
public Map<String, Integer> phrase( String input ) {
99
Map<String, Integer> countMap = new HashMap<String, Integer>();
1010
input = input.trim().toLowerCase().replaceAll("[\\W]", " ");
1111
final String[] tokenizedInput = input.split("\\s+");

‎word-count/src/test/java/WordCountTest.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void countOneWord() {
1717
final Map<String, Integer> expectedWordCount = new HashMap<String, Integer>();
1818
expectedWordCount.put("word", 1);
1919

20-
actualWordCount = wordCount.Phrase("word");
20+
actualWordCount = wordCount.phrase("word");
2121
assertEquals(
2222
expectedWordCount, actualWordCount
2323
);
@@ -31,7 +31,7 @@ public void countOneOfEach() {
3131
expectedWordCount.put("of", 1);
3232
expectedWordCount.put("each", 1);
3333

34-
actualWordCount = wordCount.Phrase("one of each");
34+
actualWordCount = wordCount.phrase("one of each");
3535
assertEquals(
3636
expectedWordCount, actualWordCount
3737
);
@@ -47,7 +47,7 @@ public void countMultipleOccurences() {
4747
expectedWordCount.put("red", 1);
4848
expectedWordCount.put("blue", 1);
4949

50-
actualWordCount = wordCount.Phrase("one fish two fish red fish blue fish");
50+
actualWordCount = wordCount.phrase("one fish two fish red fish blue fish");
5151
assertEquals(
5252
expectedWordCount, actualWordCount
5353
);
@@ -63,7 +63,7 @@ public void ignorePunctuation() {
6363
expectedWordCount.put("java", 1);
6464
expectedWordCount.put("javascript", 1);
6565

66-
actualWordCount = wordCount.Phrase("car : carpet as java : javascript!!&@$%^&");
66+
actualWordCount = wordCount.phrase("car : carpet as java : javascript!!&@$%^&");
6767
assertEquals(
6868
expectedWordCount, actualWordCount
6969
);
@@ -78,7 +78,7 @@ public void includeNumbers() {
7878
expectedWordCount.put("1", 1);
7979
expectedWordCount.put("2", 1);
8080

81-
actualWordCount = wordCount.Phrase("testing, 1, 2 testing");
81+
actualWordCount = wordCount.phrase("testing, 1, 2 testing");
8282
assertEquals(
8383
expectedWordCount, actualWordCount
8484
);
@@ -90,7 +90,7 @@ public void normalizeCase() {
9090
final Map<String, Integer> expectedWordCount = new HashMap<String, Integer>();
9191
expectedWordCount.put("go", 3);
9292

93-
actualWordCount = wordCount.Phrase("go Go GO");
93+
actualWordCount = wordCount.phrase("go Go GO");
9494
assertEquals(
9595
expectedWordCount, actualWordCount
9696
);

0 commit comments

Comments
 (0)