Esempio n. 1
0
  @Test
  public void testIsRotation_Left() {
    String s1 = "abcd";
    String s2 = "bcda";

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

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

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

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

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

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