예제 #1
0
  @Test
  public void hasLengthWithRange() {
    assert Strings.hasLength("XXX", 0);
    assert Strings.hasLength("XXX", 1);
    assert Strings.hasLength("XXX", 2);
    assert Strings.hasLength("XXX", 3);

    assert !Strings.hasLength("XXX", 4);
  }
예제 #2
0
 @Test
 public void hasLengthWithTrim() {
   assert !Strings.hasLength(" ", 1, true);
 }
예제 #3
0
 @Test
 public void hasLengthOnNotEmpty() {
   assert Strings.hasLength("X", 1);
 }
예제 #4
0
 @Test
 public void hasLengthOnEmpty() {
   assert Strings.hasLength("", 0);
 }
예제 #5
0
 @Test
 public void hasLengthOnNull() {
   assert !Strings.hasLength(null, 0);
 }
예제 #6
0
 @Test(expected = AssertionError.class)
 public void hasLengthAssertions() {
   Strings.hasLength(null, -1);
 }