@@ -126,6 +126,7 @@ Fakers
|
||||
* Sip
|
||||
* SlackEmoji
|
||||
* Space
|
||||
* StarCraft
|
||||
* StarTrek
|
||||
* Stock
|
||||
* Superhero
|
||||
|
||||
@@ -98,6 +98,7 @@ public class Faker {
|
||||
private final AquaTeenHungerForce aquaTeenHungerForce;
|
||||
private final ProgrammingLanguage programmingLanguage;
|
||||
private final Kaamelott kaamelott;
|
||||
private final StarCraft starCraft;
|
||||
private final BojackHorseman bojackHorseman;
|
||||
private final Disease disease;
|
||||
private final Basketball basketball;
|
||||
@@ -210,6 +211,7 @@ public class Faker {
|
||||
this.aquaTeenHungerForce = new AquaTeenHungerForce(this);
|
||||
this.programmingLanguage = new ProgrammingLanguage(this);
|
||||
this.kaamelott = new Kaamelott(this);
|
||||
this.starCraft = new StarCraft(this);
|
||||
this.bojackHorseman = new BojackHorseman(this);
|
||||
this.disease = new Disease(this);
|
||||
this.basketball = new Basketball(this);
|
||||
@@ -661,6 +663,10 @@ public class Faker {
|
||||
return kaamelott;
|
||||
}
|
||||
|
||||
public StarCraft starCraft() {
|
||||
return starCraft;
|
||||
}
|
||||
|
||||
public BojackHorseman bojackHorseman() { return bojackHorseman; }
|
||||
|
||||
public Disease disease() {return disease; }
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.github.javafaker;
|
||||
|
||||
public class StarCraft {
|
||||
|
||||
private final Faker faker;
|
||||
|
||||
protected StarCraft(final Faker faker) {
|
||||
this.faker = faker;
|
||||
}
|
||||
|
||||
public String unit() {
|
||||
return faker.fakeValuesService().resolve("starcraft.units", this, faker);
|
||||
}
|
||||
|
||||
public String building() {
|
||||
return faker.fakeValuesService().resolve("starcraft.buildings", this, faker);
|
||||
}
|
||||
|
||||
public String character() {
|
||||
return faker.fakeValuesService().resolve("starcraft.characters", this, faker);
|
||||
}
|
||||
|
||||
public String planet() {
|
||||
return faker.fakeValuesService().resolve("starcraft.planets", this, faker);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,6 +151,7 @@ public class EnFile {
|
||||
"source.yml",
|
||||
"south_park.yml",
|
||||
"space.yml",
|
||||
"starcraft.yml",
|
||||
"star_trek.yml",
|
||||
"star_wars.yml",
|
||||
"stargate.yml",
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
en:
|
||||
faker:
|
||||
starcraft:
|
||||
units: [
|
||||
"Archon",
|
||||
"Carrier",
|
||||
"Colossus",
|
||||
"Dark Templar",
|
||||
"High Templar",
|
||||
"Immortal",
|
||||
"Mothership",
|
||||
"Observer",
|
||||
"Phoenix",
|
||||
"Probe",
|
||||
"Sentry",
|
||||
"Stalker",
|
||||
"Void Ray",
|
||||
"Warp Prism",
|
||||
"Zealot",
|
||||
"Oracle",
|
||||
"Tempest",
|
||||
"Mothership Core",
|
||||
"Adept",
|
||||
"Disruptor",
|
||||
"Banshee",
|
||||
"Battlecruiser",
|
||||
"Ghost",
|
||||
"Hellion",
|
||||
"Marauder",
|
||||
"Marine",
|
||||
"Medivac Dropship",
|
||||
"MULE",
|
||||
"Raven",
|
||||
"Reaper",
|
||||
"SCV",
|
||||
"Siege Tank",
|
||||
"Thor",
|
||||
"Viking",
|
||||
"Auto-Turret",
|
||||
"Point Defense Drone",
|
||||
"Hellbat",
|
||||
"Widow Mine",
|
||||
"Liberator",
|
||||
"Cyclone",
|
||||
"Corruptor",
|
||||
"Brood lord",
|
||||
"Drone",
|
||||
"Hydralisk",
|
||||
"Infestor",
|
||||
"Larva",
|
||||
"Mutalisk",
|
||||
"Overlord",
|
||||
"Overseer",
|
||||
"Queen",
|
||||
"Roach",
|
||||
"Ultralisk",
|
||||
"Zergling",
|
||||
"Baneling",
|
||||
"Broodling",
|
||||
"Changeling",
|
||||
"Infested terran",
|
||||
"Swarm Host",
|
||||
"Viper",
|
||||
"Lurker",
|
||||
"Ravager"
|
||||
]
|
||||
buildings: [
|
||||
"Assimilator",
|
||||
"Cybernetics Core",
|
||||
"Dark Shrine",
|
||||
"Fleet Beacon",
|
||||
"Forge",
|
||||
"Gateway",
|
||||
"Nexus",
|
||||
"Photon Cannon",
|
||||
"Pylon",
|
||||
"Robotics Facility",
|
||||
"Robotics Bay",
|
||||
"Shield Battery",
|
||||
"Stargate",
|
||||
"Templar Archives",
|
||||
"Twilight Council",
|
||||
"Warp Gate",
|
||||
"Armory",
|
||||
"Barracks",
|
||||
"Bunker",
|
||||
"Command Center",
|
||||
"Orbital Command",
|
||||
"Planetary Fortress",
|
||||
"Engineering Bay",
|
||||
"Factory",
|
||||
"Fusion Core",
|
||||
"Ghost Academy",
|
||||
"Missile turret",
|
||||
"Refinery",
|
||||
"Sensor Tower",
|
||||
"Starport",
|
||||
"Supply Depot",
|
||||
"Reactor",
|
||||
"Tech Lab",
|
||||
"Baneling Nest",
|
||||
"Creep Tumor",
|
||||
"Evolution Chamber",
|
||||
"Extractor",
|
||||
"Hatchery",
|
||||
"Lair",
|
||||
"Hive",
|
||||
"Hydralisk Den",
|
||||
"Infestation Pit",
|
||||
"Nydus Network",
|
||||
"Nydus Worm",
|
||||
"Roach Warren",
|
||||
"Spawning Pool",
|
||||
"Spine Crawler",
|
||||
"Spire",
|
||||
"Greater Spire",
|
||||
"Spore Crawler",
|
||||
"Ultralisk Cavern",
|
||||
"Lurker Den"
|
||||
]
|
||||
characters: [
|
||||
"Abathur",
|
||||
"Alarak",
|
||||
"Aldaris",
|
||||
"Amon",
|
||||
"Artanis",
|
||||
"Daggoth",
|
||||
"Carolina Davis",
|
||||
"Dehaka",
|
||||
"Gerard DuGalle",
|
||||
"Edmund",
|
||||
"Duke",
|
||||
"Samir Duran",
|
||||
"Emil Narud",
|
||||
"Fenix",
|
||||
"Tychus Findlay",
|
||||
"Ariel Hanson",
|
||||
"Matt Horner",
|
||||
"Izsha",
|
||||
"Karax",
|
||||
"Sarah Kerrigan",
|
||||
"Arcturus Mengsk",
|
||||
"Valerian Mengsk",
|
||||
"Overmind",
|
||||
"Raszagal",
|
||||
"Jim Raynor",
|
||||
"Reigel",
|
||||
"Rohana",
|
||||
"Selendis",
|
||||
"Egon Stetmann",
|
||||
"Alexei Stukov",
|
||||
"Rory Swann",
|
||||
"Talandar",
|
||||
"Tassadar",
|
||||
"Nova Terra",
|
||||
"Gabriel Tosh",
|
||||
"Vorazun",
|
||||
"Horace Warfield",
|
||||
"Zagara",
|
||||
"Zasz",
|
||||
"Zeratul",
|
||||
"Zurvan"
|
||||
]
|
||||
planets: [
|
||||
"Abaddon",
|
||||
"Adena",
|
||||
"Aeneas",
|
||||
"Agria",
|
||||
"Aiur",
|
||||
"Alamar",
|
||||
"Albion",
|
||||
"Aleun",
|
||||
"Alpha Draconis",
|
||||
"Altara",
|
||||
"Altheon",
|
||||
"Anselm",
|
||||
"Antiga Prime",
|
||||
"Aridas",
|
||||
"Artesia Prime",
|
||||
"Artika",
|
||||
"Ash'Arak",
|
||||
"Ashrigo",
|
||||
"Aspar",
|
||||
"Asteria",
|
||||
"Astrid III",
|
||||
"Atrias",
|
||||
"Atticus Minor",
|
||||
"Avernus",
|
||||
"Bel'Shir",
|
||||
"Bellum IV",
|
||||
"Beta Saul",
|
||||
"Bhekar Ro",
|
||||
"Boone",
|
||||
"Borea",
|
||||
"Bountiful",
|
||||
"Braken",
|
||||
"Braxis",
|
||||
"Braxis Alpha",
|
||||
"Brokas Hur",
|
||||
"Brontes",
|
||||
"Brontes IV",
|
||||
"Bukari V",
|
||||
"Calus",
|
||||
"Candore",
|
||||
"Cantar",
|
||||
"Castanar",
|
||||
"Cavir",
|
||||
"Char",
|
||||
"Chau Sara",
|
||||
"Chiron",
|
||||
"Planet Christmas",
|
||||
"Cirion",
|
||||
"Cruxas III",
|
||||
"Dannuth VII",
|
||||
"Dark planet",
|
||||
"Dead Man's Rock",
|
||||
"Demon's Fair",
|
||||
"Dylar IV",
|
||||
"Earth",
|
||||
"Eldersthine",
|
||||
"Exgelia IV",
|
||||
"Feronis",
|
||||
"Formicia",
|
||||
"G-2275",
|
||||
"Gamma Dorian",
|
||||
"Gantris VI",
|
||||
"Gantuan VI",
|
||||
"Garrxax",
|
||||
"Gelgaris",
|
||||
"Glacius",
|
||||
"Gohbus",
|
||||
"Goldilocks",
|
||||
"Great Bend",
|
||||
"Grissom IV",
|
||||
"Grnaki Prime",
|
||||
"Gyras",
|
||||
"Gystt",
|
||||
"Halcyon",
|
||||
"Haven",
|
||||
"Heimdall IV",
|
||||
"Helioc III",
|
||||
"Helios",
|
||||
"Hydrax",
|
||||
"Icarus IV",
|
||||
"Ignus",
|
||||
"J'larre",
|
||||
"Jarban Minor",
|
||||
"Jontur II",
|
||||
"Jotun",
|
||||
"Ketill IV",
|
||||
"Korhal",
|
||||
"Krydon",
|
||||
"Lakius",
|
||||
"Lerilak Crest",
|
||||
"Lorcadia",
|
||||
"Luria IV",
|
||||
"LV-555",
|
||||
"Maltair IV",
|
||||
"Mar Sara",
|
||||
"Marek V",
|
||||
"Marlowe",
|
||||
"Mehlus IV",
|
||||
"Meinhoff",
|
||||
"Melkora",
|
||||
"Midr IV",
|
||||
"Miranar",
|
||||
"Mistaff IV",
|
||||
"Moria",
|
||||
"Nelyth",
|
||||
"Nemaka",
|
||||
"Nephor II",
|
||||
"New Folsom",
|
||||
"New Sydney",
|
||||
"New Trinidad",
|
||||
"Nidhogg",
|
||||
"Nidhogg III",
|
||||
"Norris VI",
|
||||
"Old Faithful",
|
||||
"Onuru Sigma",
|
||||
"Orna III",
|
||||
"Paralta",
|
||||
"Parragos",
|
||||
"Pegasus",
|
||||
"Phaeton",
|
||||
"Pho-Rekh",
|
||||
"Pike's Peak",
|
||||
"Port Zion",
|
||||
"Pridewater",
|
||||
"Raydin III",
|
||||
"Raydin IV",
|
||||
"Redstone III",
|
||||
"Revan II",
|
||||
"Revera",
|
||||
"Reynif II",
|
||||
"Roxara",
|
||||
"Saluset",
|
||||
"Samiku",
|
||||
"Sammy",
|
||||
"Scoria",
|
||||
"Seti",
|
||||
"Shakuras",
|
||||
"Shi",
|
||||
"Shiloh",
|
||||
"Sigmaris Prime",
|
||||
"Sirocco",
|
||||
"Slayn",
|
||||
"Sonyan",
|
||||
"Sorona",
|
||||
"Sutur V",
|
||||
"Swampus",
|
||||
"Tal Qirat",
|
||||
"Talvaria",
|
||||
"TarKossia",
|
||||
"Tarsonis",
|
||||
"Tashai",
|
||||
"Taurus IV",
|
||||
"Tepperus",
|
||||
"Thalon VII",
|
||||
"Thanix III",
|
||||
"Thys",
|
||||
"Timul IV",
|
||||
"Tiria",
|
||||
"Torenis Prime",
|
||||
"Torus",
|
||||
"Turaxis II",
|
||||
"Typhon XI",
|
||||
"Tyrador VIII",
|
||||
"Tyrador III",
|
||||
"Tyrador IX",
|
||||
"Uilel IV",
|
||||
"Uilila IV",
|
||||
"Ullalah II",
|
||||
"Umoja",
|
||||
"Urona Sigma",
|
||||
"Van Osten's Moon",
|
||||
"Vanass",
|
||||
"Vardona",
|
||||
"Veridia Prime",
|
||||
"Vyctor 5",
|
||||
"Vygoire",
|
||||
"Warrant VI",
|
||||
"Wotan II",
|
||||
"Xil",
|
||||
"XT39323",
|
||||
"Ynoth",
|
||||
"Zanadar Prime",
|
||||
"Zenn",
|
||||
"Zeph III",
|
||||
"Zerus",
|
||||
"Zhakul",
|
||||
"Zz'gash"
|
||||
]
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.github.javafaker;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static com.github.javafaker.matchers.MatchesRegularExpression.matchesRegularExpression;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class StarCraftTest extends AbstractFakerTest {
|
||||
|
||||
private final String noLeadingTrailingWhitespaceRegex = "^(?! )[A-Za-z0-9 ]*(?<! )$";
|
||||
|
||||
@Test
|
||||
public void testUnit() {
|
||||
String unit = faker.starCraft().unit();
|
||||
assertThat(unit, not(isEmptyOrNullString()));
|
||||
assertThat(unit, matchesRegularExpression(noLeadingTrailingWhitespaceRegex));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBuilding() {
|
||||
String building = faker.starCraft().building();
|
||||
assertThat(building, not(isEmptyOrNullString()));
|
||||
assertThat(building, matchesRegularExpression(noLeadingTrailingWhitespaceRegex));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCharacter() {
|
||||
String character = faker.starCraft().character();
|
||||
assertThat(character, not(isEmptyOrNullString()));
|
||||
assertThat(character, matchesRegularExpression(noLeadingTrailingWhitespaceRegex));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlanet() {
|
||||
String planet = faker.starCraft().planet();
|
||||
assertThat(planet, not(isEmptyOrNullString()));
|
||||
assertThat(planet, matchesRegularExpression(noLeadingTrailingWhitespaceRegex));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -169,6 +169,7 @@ public class FakerIT {
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.aquaTeenHungerForce());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.programmingLanguage());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.kaamelott());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.starCraft());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.bojackHorseman());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.disease());
|
||||
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.basketball());
|
||||
|
||||
Reference in New Issue
Block a user