Skip to content

Commit

Permalink
Made the data classes static. (#75)
Browse files Browse the repository at this point in the history
* Made the AddressData class static.

* Ensuring that the data is readonly.

* Made the AppData class static.

* Made the BookData class static.

* Made the FriendsData class static.

* Made the NameData class static.

* Made the ZeldaData class static.

* Added readonly to BookData fields.

* Changed internal to public, because the class itself is internal.

* Made LoremData fields readonly.

* Made the PokemonData class static.

* Updated the PokemonFaker tests.

* Removed unused usings.
  • Loading branch information
mrstebo committed Oct 16, 2018
1 parent f73ba45 commit 4610a7f
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 237 deletions.
40 changes: 20 additions & 20 deletions src/FakerDotNet/Data/AddressData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class AddressData
internal static class AddressData
{
public IEnumerable<string> CityPrefixes = new[]
public static readonly IEnumerable<string> CityPrefixes = new[]
{
"North",
"East",
Expand All @@ -15,7 +15,7 @@ internal class AddressData
"Port"
};

public IEnumerable<string> CitySuffixes = new[]
public static readonly IEnumerable<string> CitySuffixes = new[]
{
"town",
"ton",
Expand All @@ -38,7 +38,7 @@ internal class AddressData
"shire"
};

public IEnumerable<string> Countries = new[]
public static readonly IEnumerable<string> Countries = new[]
{
"Afghanistan",
"Albania",
Expand Down Expand Up @@ -287,7 +287,7 @@ internal class AddressData
"Zimbabwe"
};

public IEnumerable<string> CountryCodes = new[]
public static readonly IEnumerable<string> CountryCodes = new[]
{
"AD",
"AE",
Expand Down Expand Up @@ -541,7 +541,7 @@ internal class AddressData
"ZW"
};

public IEnumerable<string> LongCountryCodes = new[]
public static readonly IEnumerable<string> LongCountryCodes = new[]
{
"ABW",
"AFG",
Expand Down Expand Up @@ -794,14 +794,14 @@ internal class AddressData
"ZWE"
};

public IEnumerable<string> BuildingNumbers = new[]
public static readonly IEnumerable<string> BuildingNumbers = new[]
{
"#####",
"####",
"###"
};

public IEnumerable<string> CommunityPrefixes = new[]
public static readonly IEnumerable<string> CommunityPrefixes = new[]
{
"Park",
"Summer",
Expand All @@ -814,7 +814,7 @@ internal class AddressData
"Willow"
};

public IEnumerable<string> CommunitySuffixes = new[]
public static readonly IEnumerable<string> CommunitySuffixes = new[]
{
"Village",
"Creek",
Expand All @@ -830,7 +830,7 @@ internal class AddressData
"Heights"
};

public IEnumerable<string> StreetSuffixes = new[]
public static readonly IEnumerable<string> StreetSuffixes = new[]
{
"Alley",
"Avenue",
Expand Down Expand Up @@ -1059,19 +1059,19 @@ internal class AddressData
"Wells"
};

public IEnumerable<string> SecondaryAddressPrefixes = new[]
public static readonly IEnumerable<string> SecondaryAddressPrefixes = new[]
{
"Apt. ###",
"Suite ###"
};

public IEnumerable<string> Postcodes = new[]
public static readonly IEnumerable<string> Postcodes = new[]
{
"#####",
"#####-####"
};

public IDictionary<string, string> PostcodeByState = new Dictionary<string, string>
public static readonly IDictionary<string, string> PostcodeByState = new Dictionary<string, string>
{

{"AL", "350##"},
Expand Down Expand Up @@ -1128,7 +1128,7 @@ internal class AddressData
{"WY", "831##"}
};

public IEnumerable<string> States = new[]
public static readonly IEnumerable<string> States = new[]
{
"Alabama",
"Alaska",
Expand Down Expand Up @@ -1182,7 +1182,7 @@ internal class AddressData
"Wyoming"
};

public IEnumerable<string> StateAbbreviations = new[]
public static readonly IEnumerable<string> StateAbbreviations = new[]
{
"AL",
"AK",
Expand Down Expand Up @@ -1236,7 +1236,7 @@ internal class AddressData
"WY"
};

public IEnumerable<string> TimeZones = new[]
public static readonly IEnumerable<string> TimeZones = new[]
{
"Pacific/Midway",
"Pacific/Pago_Pago",
Expand Down Expand Up @@ -1383,26 +1383,26 @@ internal class AddressData
"Pacific/Apia"
};

public IEnumerable<string> Cities = new[]
public static readonly IEnumerable<string> Cities = new[]
{
"{CityPrefix} {Name.FirstName}{CitySuffix}",
"{CityPrefix} {Name.FirstName}",
"{Name.FirstName}{CitySuffix}",
"{Name.LastName}{CitySuffix}"
};

public IEnumerable<string> StreetNames = new[]
public static readonly IEnumerable<string> StreetNames = new[]
{
"{Name.FirstName} {StreetSuffix}",
"{Name.LastName} {StreetSuffix}"
};

public IEnumerable<string> StreetAddresses = new[]
public static readonly IEnumerable<string> StreetAddresses = new[]
{
"{BuildingNumber} {StreetName}"
};

public IEnumerable<string> FullAddresses = new[]
public static readonly IEnumerable<string> FullAddresses = new[]
{
"{StreetAddress}, {City}, {StateAbbr} {ZipCode}",
"{SecondaryAddress} {StreetAddress}, {City}, {StateAbbr} {ZipCode}"
Expand Down
8 changes: 4 additions & 4 deletions src/FakerDotNet/Data/AppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class AppData
internal static class AppData
{
public IEnumerable<string> Names => new[]
public static readonly IEnumerable<string> Names = new[]
{
"Redhold",
"Treeflex",
Expand Down Expand Up @@ -90,7 +90,7 @@ internal class AppData
"Flexidy"
};

public IEnumerable<string> Versions => new[]
public static readonly IEnumerable<string> Versions = new[]
{
"0.#.#",
"0.##",
Expand All @@ -99,4 +99,4 @@ internal class AppData
"#.#."
};
}
}
}
8 changes: 4 additions & 4 deletions src/FakerDotNet/Data/BookData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class BookData
internal static class BookData
{
public IEnumerable<string> Titles => new[]
public static readonly IEnumerable<string> Titles = new[]
{
"Absalom, Absalom!",
"After Many a Summer Dies the Swan",
Expand Down Expand Up @@ -198,7 +198,7 @@ internal class BookData
"The Yellow Meads of Asphodel"
};

public IEnumerable<string> Publishers => new[]
public static readonly IEnumerable<string> Publishers = new[]
{
"Academic Press",
"Ace Books",
Expand Down Expand Up @@ -466,7 +466,7 @@ internal class BookData
"Zondervan"
};

public IEnumerable<string> Genres => new[]
public static readonly IEnumerable<string> Genres = new[]
{
"Classic",
"Comic/Graphic Novel",
Expand Down
8 changes: 4 additions & 4 deletions src/FakerDotNet/Data/FriendsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class FriendsData
internal static class FriendsData
{
public IEnumerable<string> Characters => new[]
public static readonly IEnumerable<string> Characters = new[]
{
"Rachel Green",
"Joey Tribbiani",
Expand All @@ -20,7 +20,7 @@ internal class FriendsData
"Miss Chanandler Bong"
};

public IEnumerable<string> Locations => new[]
public static readonly IEnumerable<string> Locations = new[]
{
"Central Perk",
"Javu",
Expand All @@ -31,7 +31,7 @@ internal class FriendsData
"15 Yemen Road, Yemen"
};

public IEnumerable<string> Quotes => new[]
public static readonly IEnumerable<string> Quotes = new[]
{
"We were on a break!",
"Forty-two to twenty-one! Like the turkey, Ross is done!",
Expand Down
8 changes: 4 additions & 4 deletions src/FakerDotNet/Data/LoremData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace FakerDotNet.Data
{
internal static class LoremData
{
public static IEnumerable<string> Characters = new[]
public static readonly IEnumerable<string> Characters = new[]
{
"a",
"b",
Expand Down Expand Up @@ -34,14 +34,14 @@ internal static class LoremData
"z"
};

public static IEnumerable<byte[]> Multibytes = new[]
public static readonly IEnumerable<byte[]> Multibytes = new[]
{
new byte[] {240, 159, 152, 128},
new byte[] {240, 159, 152, 161},
new byte[] {226, 157, 164}
};

public static IEnumerable<string> Words = new[]
public static readonly IEnumerable<string> Words = new[]
{
"alias",
"consequatur",
Expand Down Expand Up @@ -294,7 +294,7 @@ internal static class LoremData
"repellat"
};

public static IEnumerable<string> Supplemental = new[]
public static readonly IEnumerable<string> Supplemental = new[]
{
"abbas",
"abduco",
Expand Down
16 changes: 8 additions & 8 deletions src/FakerDotNet/Data/NameData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class NameData
internal static class NameData
{
public IEnumerable<string> FirstNames => new[]
public static readonly IEnumerable<string> FirstNames = new[]
{
"Aaliyah",
"Aaron",
Expand Down Expand Up @@ -3016,7 +3016,7 @@ internal class NameData
"Zula"
};

public IEnumerable<string> LastNames => new[]
public static readonly IEnumerable<string> LastNames = new[]
{
"Abbott",
"Abernathy",
Expand Down Expand Up @@ -3494,7 +3494,7 @@ internal class NameData
"Zulauf"
};

public IEnumerable<string> Prefixes => new[]
public static readonly IEnumerable<string> Prefixes = new[]
{
"Mr.",
"Mrs.",
Expand All @@ -3503,7 +3503,7 @@ internal class NameData
"Dr."
};

public IEnumerable<string> Suffixes => new[]
public static readonly IEnumerable<string> Suffixes = new[]
{
"Jr.",
"Sr.",
Expand All @@ -3518,7 +3518,7 @@ internal class NameData
"DVM"
};

public IEnumerable<string> TitleDescriptors => new[]
public static readonly IEnumerable<string> TitleDescriptors = new[]
{
"Lead",
"Senior",
Expand All @@ -3544,7 +3544,7 @@ internal class NameData
"Principal"
};

public IEnumerable<string> TitleLevels => new[]
public static readonly IEnumerable<string> TitleLevels = new[]
{
"Solutions",
"Program",
Expand Down Expand Up @@ -3585,7 +3585,7 @@ internal class NameData
"Metrics"
};

public IEnumerable<string> TitleJobs => new[]
public static readonly IEnumerable<string> TitleJobs = new[]
{
"Supervisor",
"Associate",
Expand Down
10 changes: 5 additions & 5 deletions src/FakerDotNet/Data/PokemonData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FakerDotNet.Data
{
internal class PokemonData
internal static class PokemonData
{
internal IEnumerable<string> Names => new[]
public static readonly IEnumerable<string> Names = new[]
{
"Bulbasaur",
"Ivysaur",
Expand Down Expand Up @@ -159,7 +159,7 @@ internal class PokemonData
"Mew"
};

internal IEnumerable<string> Locations => new[]
public static readonly IEnumerable<string> Locations = new[]
{
"Accumula Town",
"Ambrette Town",
Expand Down Expand Up @@ -261,7 +261,7 @@ internal class PokemonData
"White Forest"
};

internal IEnumerable<string> Moves => new[]
public static readonly IEnumerable<string> Moves = new[]
{
"Absorb",
"Acid",
Expand Down Expand Up @@ -430,4 +430,4 @@ internal class PokemonData
"Wrap"
};
}
}
}
Loading

0 comments on commit 4610a7f

Please sign in to comment.