lots of exercises in java... from https://github.com/exercism/java

ReverseStringTest.java 897B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import org.junit.Ignore;
  2. import org.junit.Test;
  3. import static org.junit.Assert.assertEquals;
  4. public class ReverseStringTest {
  5. @Test
  6. public void testAnEmptyString() {
  7. assertEquals("", new ReverseString().reverse(""));
  8. }
  9. @Ignore("Remove to run test")
  10. @Test
  11. public void testAWord() {
  12. assertEquals("tobor", new ReverseString().reverse("robot"));
  13. }
  14. @Ignore("Remove to run test")
  15. @Test
  16. public void testACapitalizedWord() {
  17. assertEquals("nemaR", new ReverseString().reverse("Ramen"));
  18. }
  19. @Ignore("Remove to run test")
  20. @Test
  21. public void testASentenceWithPunctuation() {
  22. assertEquals("!yrgnuh m'I", new ReverseString().reverse("I'm hungry!"));
  23. }
  24. @Ignore("Remove to run test")
  25. @Test
  26. public void testAPalindrome() {
  27. assertEquals("racecar", new ReverseString().reverse("racecar"));
  28. }
  29. }