Test Rotate String
Declare a public class
TestRotateString with a single void static method named
testRotateString receives an instance of
RotateString as a parameter, which has a single method
rotate takes a
String and an
int as arguments, and rotates the passed string by the passed amount.
If the amount is positive, the rotation is to the right; if negative, to the left.
rotate should return
testRotateString method should test the passed implementation using
Here's an example to get you started:
As you create your test suite, consider the various kinds of mistakes that you might make when implementing
rotate. Maybe getting the direction wrong, or using the modulus improperly? There are lots of ways to mess this
up! You need to catch all of them. Good luck!