diff --git a/Faker.Net.NUnit.Tests/AddressTests.cs b/Faker.Net.NUnit.Tests/AddressTests.cs index 304222f..791cdf2 100644 --- a/Faker.Net.NUnit.Tests/AddressTests.cs +++ b/Faker.Net.NUnit.Tests/AddressTests.cs @@ -95,5 +95,22 @@ public void TestWorldCountry() { Assert.IsTrue(Regex.IsMatch(Address.GetCountry(), @"[ a-z]")); } - } + [Test] + public void TestAUState() + { + Assert.IsTrue(Regex.IsMatch(Address.GetAUState(), @"[ a-z]")); + } + + [Test] + public void TestAUStateAbbr() + { + Assert.IsTrue(Regex.IsMatch(Address.GetAUStateAbbr(), @"[A-Z]")); + } + + [Test] + public void TestAUPostCode() + { + Assert.IsTrue(Regex.IsMatch(Address.GetAUPostcode(), @"[0-9]")); + } + } } \ No newline at end of file diff --git a/Faker.Net/Address.cs b/Faker.Net/Address.cs index c8a12e5..ed5d7ab 100644 --- a/Faker.Net/Address.cs +++ b/Faker.Net/Address.cs @@ -93,6 +93,23 @@ public static string GetUKPostcode() return UK_POSTCODE.Rand().Bothify().ToUpper(); } + // AU Variants + public static string GetAUState() + { + return AU_STATE.Rand(); + } + + public static string GetAUStateAbbr() + { + return AU_STATE_ABBR.Rand(); + } + + public static string GetAUPostcode() + { + return AU_POSTCODE.Rand().Numerify(); + } + + public static string GetNeighborhood() { return NEIGHBORHOOD.Rand(); @@ -268,6 +285,12 @@ public static string Neighborhood() "Olmsted Falls Central", "South of Lake Shore Blvd", "Gates Mills North", "White Oak South of Columbia Pike", "Rockville East of Hungerford Dr", "Cleveland Park" }; + static readonly string[] AU_STATE = new[] {" New South Wales", "Victoria", "Queensland", "South Australia", + "Western Australia", "Tasmania", "Australian Capital Territory" }; + + static readonly string[] AU_STATE_ABBR = new[] { "NSW", "VIC", "QLD", "SA", "WA", "TAS", "ACT" }; + + static readonly string[] AU_POSTCODE = new[] { "####" }; public static readonly string[] COUNTRY = { "Ă…land Islands",