Skip to content

Update code review activity with my code#27

Open
BensGitHub2022 wants to merge 1 commit intomainfrom
Ben_Feldman_CodeReview
Open

Update code review activity with my code#27
BensGitHub2022 wants to merge 1 commit intomainfrom
Ben_Feldman_CodeReview

Conversation

@BensGitHub2022
Copy link

No description provided.

@sarafarag sarafarag requested review from meelybug123 and ness-miewald and removed request for meelybug123 June 16, 2023 19:30
Copy link

@ness-miewald ness-miewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope all of these help :D


@Test
// Checks behavior for not preserving whitespace
public void testRemoveNthCharacter1() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//don't forget at the end
assertEquals("Expected result", expectedArray, sStrings);

}

@Test
// Checks behavior for restoring string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants