Conversation
haileymandal
left a comment
There was a problem hiding this comment.
Your test cases look great. You did a few corner cases that I didn't think about. One suggestion I have for them is changing the test case methods to show what you are doing vs comments above them.
For example: "public void removeNthCharacter_maintainSpacingFalse_returnsStringWithoutSpaces"
This is formatting and up to developers preference but I found it helpful when doing it myself.
|
|
||
|
|
||
| // Parameterized constructor | ||
| StringManipulation(String string) { |
There was a problem hiding this comment.
I see you have separate constructors, one default and other parameterized. I was thinking you could merge and have one constructor. What do you think?
| throw new IllegalArgumentException("n has to be at least 1"); | ||
| } | ||
|
|
||
| String string = this.getString(); |
There was a problem hiding this comment.
I see in the last method, you called getString();. I think you could do the same here and do not need this.
| this.string = string; | ||
| } | ||
|
|
||
| // todo: raise nullPointer Exception if string is null |
There was a problem hiding this comment.
I noticed this comment you had left for todo. I thought I would share that this is a great idea for a test case.
No description provided.