예제 #1
0
  @Test
  public void testIsRotation_Left() {
    String s1 = "abcd";
    String s2 = "bcda";

    assertTrue(Question_1_9.isRotation(s1, s2));
  }
예제 #2
0
  @Test
  public void testIsRotation_Null() {
    String s1 = "abc";
    String s2 = null;

    assertFalse(Question_1_9.isRotation(s1, s2));
  }
예제 #3
0
  @Test
  public void testIsRotation_Empty() {
    String s1 = "";
    String s2 = "bcd";

    assertFalse(Question_1_9.isRotation(s1, s2));
  }
예제 #4
0
  @Test
  public void testIsRotation_DifferentLength() {
    String s1 = "abcd";
    String s2 = "bcd";

    assertFalse(Question_1_9.isRotation(s1, s2));
  }
예제 #5
0
  @Test
  public void testIsRotation_False() {
    String s1 = "abcd";
    String s2 = "acbd";

    assertFalse(Question_1_9.isRotation(s1, s2));
  }
예제 #6
0
  @Test
  public void testIsRotation_Right() {
    String s1 = "abcd";
    String s2 = "dabc";

    assertTrue(Question_1_9.isRotation(s1, s2));
  }