Skip to content

Commit

Permalink
Update UserNameTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ZJ-Ye committed May 8, 2020
1 parent 87f0997 commit 8f13962
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/github/javafaker/UserNameTest.java
Expand Up @@ -24,6 +24,13 @@ public void testUsernameCase1(){
}


@Test //This test case is trying to test when min==max, in other words we produce the username in a fixed length
public void testUsernameCase2(){
String test = faker.name().username(17,40);
assertThat(test, matchesRegularExpression("^(\\w+)\\.(\\w+)$"));
assertThat(test.length(),allOf(greaterThanOrEqualTo(16), lessThanOrEqualTo(40)));
}

@Test //This test case is trying to test when the max < 6 or min >25, then we will return an error message
public void OutOfBoundary(){
String test1 = faker.name().username(1,5);
Expand Down

0 comments on commit 8f13962

Please sign in to comment.