Merge remote-tracking branch 'upstream/master' into add-programming-language

This commit is contained in:
Eric Goetschalckx
2019-09-11 12:38:21 -04:00
5 changed files with 40 additions and 2 deletions
+2 -1
View File
@@ -56,10 +56,11 @@ See [CONTRIBUTING.md](https://github.com/DiUS/java-faker/blob/master/CONTRIBUTIN
Fakers
-----
* Address
* Ancient
* Animal
* Address
* App
* Aqua Teen Hunger Force
* Artist
* Avatar
* Back To The Future
@@ -0,0 +1,15 @@
package com.github.javafaker;
public class AquaTeenHungerForce {
private final Faker faker;
protected AquaTeenHungerForce(Faker faker) {
this.faker = faker;
}
public String character() {
return faker.fakeValuesService().resolve("aqua_teen_hunger_force.character", this, faker);
}
}
@@ -93,6 +93,7 @@ public class Faker {
private final Relationships relationships;
private final Nation nation;
private final Dune dune;
private final AquaTeenHungerForce aquaTeenHungerForce;
private final ProgrammingLanguage programmingLanguage;
public Faker() {
@@ -188,6 +189,7 @@ public class Faker {
this.relationships = new Relationships(this);
this.nation = new Nation(this);
this.dune = new Dune(this);
this.aquaTeenHungerForce = new AquaTeenHungerForce(this);
this.programmingLanguage = new ProgrammingLanguage(this);
}
@@ -611,10 +613,14 @@ public class Faker {
return dune;
}
public AquaTeenHungerForce aquaTeenHungerForce() {
return aquaTeenHungerForce;
}
public ProgrammingLanguage programmingLanguage() {
return programmingLanguage;
}
public String resolve(String key) {
return this.fakeValuesService.resolve(key, this, this);
}
@@ -0,0 +1,15 @@
package com.github.javafaker;
import org.junit.Test;
import static com.github.javafaker.matchers.MatchesRegularExpression.matchesRegularExpression;
import static org.junit.Assert.assertThat;
public class AquaTeenHungerForceTest extends AbstractFakerTest {
@Test
public void character() {
assertThat(faker.aquaTeenHungerForce().character(), matchesRegularExpression("[A-Za-z .]+"));
}
}
@@ -159,6 +159,7 @@ public class FakerIT {
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.relationships());
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.nation());
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.dune());
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.aquaTeenHungerForce());
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.programmingLanguage());
}