Conversation
| @Override | ||
| public int count() { | ||
| return 0; | ||
| if(myString == null){ |
There was a problem hiding this comment.
Line 16 and 21 can be combined since both will always result in countWords being zero.
| public void testCount4() { | ||
| fail("Not yet implemented"); | ||
| //sixth test | ||
| public void count_leadingSpace_returnsCorrectCount(){ |
There was a problem hiding this comment.
this test seems a little redundant since the test above already tests if a space might accidently count another word.
| @Test | ||
| public void testRestoreString5() | ||
| //twenty-ninth test case | ||
| public void restoreString_upperCaseAndLowerCaseLetters_returnsRestoredString() |
There was a problem hiding this comment.
This test might seem be redundant after looking at the implementation, but I can understand why this was tested in the case that the implementation was different.
|
|
||
| @Test | ||
| //thirtieth test case | ||
| public void restoreString_repeatedLetters_returnsRestoredString() |
There was a problem hiding this comment.
Test might be unnecessary since method is only concerned with the indices.
| return countWords; | ||
| } | ||
|
|
||
| String removeSpace = myString.trim(); |
There was a problem hiding this comment.
It looks like you could potentially check if removeSpace.equals("") could be checked before going into the for loop since .trim() should remove all the leading and trailing spaces. In the case of the string "_ _ _ _" (spacing between _'s used to clarify example), spaces would be removed, thus leaving you a string "" and you can return before the loop.
No description provided.