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

Class HarryPotterTest

src/test/java/com/github/javafaker/HarryPotterTest.java:10–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import static org.junit.Assert.assertThat;
9
10public class HarryPotterTest extends AbstractFakerTest {
11
12 @Test
13 public void character() {
14 assertThat(faker.harryPotter().character(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
15 }
16
17 @Test
18 public void location() {
19 assertThat(faker.harryPotter().location(), matchesRegularExpression("[A-Za-z0-9'\\. &,/]+"));
20 }
21
22 @Test
23 public void quote() {
24 assertThat(faker.harryPotter().quote(), not(isEmptyOrNullString()));
25 }
26
27 @Test
28 public void book() {
29 assertThat(faker.harryPotter().book(), matchesRegularExpression("Harry Potter and the ([A-Za-z'\\-]+ ?)+"));
30 }
31
32 @Test
33 public void house() {
34 assertThat(faker.harryPotter().house(), matchesRegularExpression("[A-Za-z ]+"));
35 }
36
37 @Test
38 public void spell() {
39 assertThat(faker.harryPotter().spell(), matchesRegularExpression("[A-Za-z ]+"));
40 }
41}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected