Conversation
|
|
||
| @Test | ||
| // Checks behavior for not preserving whitespace | ||
| public void testRemoveNthCharacter1() { |
There was a problem hiding this comment.
I think you need something like this in StringManipulation.java to help be able to test this code.
public String removeNthCharacter(int index, boolean caseSensitive) {
// Implementation logic to remove the nth character from the inputString
// based on the provided index and case sensitivity
// Placeholder return statement
return null;
}
| // Checks behavior for substrings | ||
| public void testGeSubStrings1() { | ||
| manipulatedstring.setString("This is my string"); | ||
| String [] sStings = manipulatedstring.getSubStrings(3, 4); |
There was a problem hiding this comment.
//don't forget at the end
assertEquals("Expected result", expectedArray, sStrings);
| } | ||
|
|
||
| @Test | ||
| // Checks behavior for restoring string |
There was a problem hiding this comment.
//for this test I would try something like this
public void testRestoreString1() {
manipulatedstring.setString("art");
manipulatedstring.reverseString();
manipulatedstring.removeNthCharacter(1, true);
manipulatedstring.restoreString();
String restoredString = manipulatedstring.getString();
assertEquals("Expected restored string", "art", restoredString);
}
| } | ||
|
|
||
| @Test | ||
| // Checks behavior for a string |
There was a problem hiding this comment.
//I think this test works, I'm not quite sure why it's not showing up green but I would try something like this:
@test
public void testCount1() {
manipulatedstring.setString("This is my string");
int length = manipulatedstring.count();
assertEquals(17, length);
}
No description provided.