Add methods for missing Harry Potter entries

This commit is contained in:
ubulem
2019-08-20 15:10:32 +06:00
parent 5f357f7e80
commit e481bde9cb
2 changed files with 18 additions and 0 deletions
@@ -22,4 +22,12 @@ public class HarryPotter {
public String book() {
return faker.resolve("harry_potter.books");
}
public String house() {
return faker.resolve("harry_potter.houses");
}
public String spell() {
return faker.resolve("harry_potter.spells");
}
}
@@ -28,4 +28,14 @@ public class HarryPotterTest extends AbstractFakerTest {
public void book() {
assertThat(faker.harryPotter().book(), matchesRegularExpression("Harry Potter and the ([A-Za-z'\\-]+ ?)+"));
}
@Test
public void house() {
assertThat(faker.harryPotter().house(), matchesRegularExpression("[A-Za-z ]+"));
}
@Test
public void spell() {
assertThat(faker.harryPotter().spell(), matchesRegularExpression("[A-Za-z ]+"));
}
}