MCPcopy Create free account
hub / github.com/DiUS/java-faker / BookTest

Class BookTest

src/test/java/com/github/javafaker/BookTest.java:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import static org.junit.Assert.assertThat;
7
8public class BookTest extends AbstractFakerTest {
9
10 @Test
11 public void testTitle() {
12 assertThat(faker.book().title(), matchesRegularExpression("([\\p{L}'\\-\\?]+[!,]? ?){2,9}"));
13 }
14
15 @Test
16 public void testAuthor() {
17 assertThat(faker.book().author(), matchesRegularExpression("([\\w']+\\.? ?){2,3}"));
18 }
19
20 @Test
21 public void testPublisher() {
22 assertThat(faker.book().publisher(), matchesRegularExpression("([\\p{L}'&\\-]+[,.]? ?){1,5}"));
23 }
24
25 @Test
26 public void testGenre() {
27 assertThat(faker.book().genre(), matchesRegularExpression("([\\w/]+ ?){2,4}"));
28 }
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected