resolved #9 added test to verify bothify works

This commit is contained in:
Ren Shao
2013-12-23 11:13:46 +11:00
parent fee1da2eb6
commit 6aab9d1842
2 changed files with 19 additions and 0 deletions
+6
View File
@@ -61,5 +61,11 @@
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,13 @@
package com.github.javafaker;
import org.junit.Assert;
import org.junit.Test;
public class BothifyTest {
private Faker faker = new Faker();
@Test
public void shouldGenerateLettersAndNumbers() {
Assert.assertTrue(faker.bothify("????##@gmail.com").matches("\\w{4}\\d{2}@gmail.com"));
}
}