-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
277 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Faker.Ancient | ||
|
||
Available since version 1.7.0. | ||
|
||
```cs | ||
Faker.Ancient.God() //=> "Zeus" | ||
Faker.Ancient.Primordial() //=> "Gaia" | ||
Faker.Ancient.Titan() //=> "Atlas" | ||
Faker.Ancient.Hero() //=> "Achilles" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace FakerDotNet.Data | ||
{ | ||
internal static class AncientData | ||
{ | ||
public static readonly IEnumerable<string> Gods = new[] | ||
{ | ||
"Aphrodite", | ||
"Apollo", | ||
"Ares", | ||
"Artemis", | ||
"Athena", | ||
"Demeter", | ||
"Dionysus", | ||
"Hades", | ||
"Hephaestus", | ||
"Hera", | ||
"Hermes", | ||
"Hestia", | ||
"Poseidon", | ||
"Zeus" | ||
}; | ||
|
||
public static readonly IEnumerable<string> Primordials = new[] | ||
{ | ||
"Aion", | ||
"Aether", | ||
"Ananke", | ||
"Chaos", | ||
"Chronos", | ||
"Erebus", | ||
"Eros", | ||
"Hypnos", | ||
"Nesoi", | ||
"Uranus", | ||
"Gaia", | ||
"Ourea", | ||
"Phanes", | ||
"Pontus", | ||
"Tartarus", | ||
"Thalassa", | ||
"Thanatos", | ||
"Hemera", | ||
"Nyx", | ||
"Nemesis" | ||
}; | ||
|
||
public static readonly IEnumerable<string> Titans = new[] | ||
{ | ||
"Coeus", | ||
"Crius", | ||
"Cronus", | ||
"Hyperion", | ||
"Iapetus", | ||
"Mnemosyne", | ||
"Oceanus", | ||
"Phoebe", | ||
"Rhea", | ||
"Tethys", | ||
"Theia", | ||
"Themis", | ||
"Asteria", | ||
"Astraeus", | ||
"Atlas", | ||
"Aura", | ||
"Clymene", | ||
"Dione", | ||
"Helios", | ||
"Selene", | ||
"Eos", | ||
"Epimetheus", | ||
"Eurybia", | ||
"Eurynome", | ||
"Lelantos", | ||
"Leto", | ||
"Menoetius", | ||
"Metis", | ||
"Ophion", | ||
"Pallas", | ||
"Perses", | ||
"Prometheus", | ||
"Styx" | ||
}; | ||
|
||
public static readonly IEnumerable<string> Heroes = new[] | ||
{ | ||
"Abderus", | ||
"Achilles", | ||
"Aeneas", | ||
"Ajax", | ||
"Amphitryon", | ||
"Antilochus", | ||
"Bellerophon", | ||
"Castor", | ||
"Chrysippus", | ||
"Daedalus", | ||
"Diomedes", | ||
"Eleusis", | ||
"Eunostus", | ||
"Ganymede", | ||
"Hector", | ||
"Hercules", | ||
"Icarus", | ||
"Iolaus", | ||
"Jason", | ||
"Meleager", | ||
"Odysseus", | ||
"Orpheus", | ||
"Pandion", | ||
"Perseus", | ||
"Theseus", | ||
"Alcestis", | ||
"Amymone", | ||
"Andromache", | ||
"Andromeda", | ||
"Antigone", | ||
"Arachne", | ||
"Ariadne", | ||
"Atalanta", | ||
"Briseis", | ||
"Caeneus", | ||
"Cassandra", | ||
"Cassiopeia", | ||
"Clytemnestra", | ||
"Danaë", | ||
"Deianeira", | ||
"Electra", | ||
"Europa", | ||
"Hecuba", | ||
"Helen", | ||
"Hermione", | ||
"Iphigenia", | ||
"Ismene", | ||
"Jocasta", | ||
"Medea", | ||
"Medusa", | ||
"Niobe", | ||
"Pandora", | ||
"Penelope", | ||
"Phaedra", | ||
"Polyxena", | ||
"Semele", | ||
"Thrace" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using FakerDotNet.Data; | ||
|
||
namespace FakerDotNet.Fakers | ||
{ | ||
public interface IAncientFaker | ||
{ | ||
string God(); | ||
string Primordial(); | ||
string Titan(); | ||
string Hero(); | ||
} | ||
|
||
internal class AncientFaker : IAncientFaker | ||
{ | ||
private readonly IFakerContainer _fakerContainer; | ||
|
||
public AncientFaker(IFakerContainer fakerContainer) | ||
{ | ||
_fakerContainer = fakerContainer; | ||
} | ||
|
||
public string God() | ||
{ | ||
return _fakerContainer.Random.Element(AncientData.Gods); | ||
} | ||
|
||
public string Primordial() | ||
{ | ||
return _fakerContainer.Random.Element(AncientData.Primordials); | ||
} | ||
|
||
public string Titan() | ||
{ | ||
return _fakerContainer.Random.Element(AncientData.Titans); | ||
} | ||
|
||
public string Hero() | ||
{ | ||
return _fakerContainer.Random.Element(AncientData.Heroes); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using FakeItEasy; | ||
using FakerDotNet.Data; | ||
using FakerDotNet.Fakers; | ||
using NUnit.Framework; | ||
|
||
namespace FakerDotNet.Tests.Fakers | ||
{ | ||
[TestFixture] | ||
[Parallelizable] | ||
public class AncientFakerTests | ||
{ | ||
[SetUp] | ||
public void SetUp() | ||
{ | ||
_fakerContainer = A.Fake<IFakerContainer>(); | ||
_ancientFaker = new AncientFaker(_fakerContainer); | ||
} | ||
|
||
private IFakerContainer _fakerContainer; | ||
private IAncientFaker _ancientFaker; | ||
|
||
[Test] | ||
public void God_returns_a_god() | ||
{ | ||
A.CallTo(() => _fakerContainer.Random.Element(AncientData.Gods)) | ||
.Returns("Zeus"); | ||
|
||
Assert.AreEqual("Zeus", _ancientFaker.God()); | ||
} | ||
|
||
[Test] | ||
public void Primordial_returns_a_primordial() | ||
{ | ||
A.CallTo(() => _fakerContainer.Random.Element(AncientData.Primordials)) | ||
.Returns("Gaia"); | ||
|
||
Assert.AreEqual("Gaia", _ancientFaker.Primordial()); | ||
} | ||
|
||
[Test] | ||
public void Titan_returns_a_titan() | ||
{ | ||
A.CallTo(() => _fakerContainer.Random.Element(AncientData.Titans)) | ||
.Returns("Atlas"); | ||
|
||
Assert.AreEqual("Atlas", _ancientFaker.Titan()); | ||
} | ||
|
||
[Test] | ||
public void Hero_returns_a_hero() | ||
{ | ||
A.CallTo(() => _fakerContainer.Random.Element(AncientData.Heroes)) | ||
.Returns("Achilles"); | ||
|
||
Assert.AreEqual("Achilles", _ancientFaker.Hero()); | ||
} | ||
} | ||
} |