diff --git a/src/World.Net.UnitTests/Countries/GeorgiaTest.cs b/src/World.Net.UnitTests/Countries/GeorgiaTest.cs new file mode 100644 index 0000000..5b952eb --- /dev/null +++ b/src/World.Net.UnitTests/Countries/GeorgiaTest.cs @@ -0,0 +1,59 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class GeorgiaTest : AssertCountryTestBase +{ + private const string GEORGIA_COUNTRY_NAME = "Georgia"; + private const string GEORGIA_NATIVE_NAME = "საქართველო"; + private const string GEORGIA_CAPITAL = "Tbilisi"; + private const string GEORGIA_OFFICIAL_NAME = "Georgia"; + private const string GEORGIA_ISO2_CODE = "GE"; + private const string GEORGIA_ISO3_CODE = "GEO"; + private const int GEORGIA_NUMERIC_CODE = 268; + private readonly string[] GEORGIA_CALLING_CODE = ["+995"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Georgia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + // Autonomous Republics + new("Abkhazia", "GE-AB", "Autonomous Republic"), + new("Adjara", "GE-AJ", "Autonomous Republic"), + + // Regions + new("Guria", "GE-GU", "Region"), + new("Imereti", "GE-IM", "Region"), + new("Kakheti", "GE-KA", "Region"), + new("Kvemo Kartli", "GE-KK", "Region"), + new("Mtskheta-Mtianeti", "GE-MM", "Region"), + new("Racha-Lechkhumi and Kvemo Svaneti", "GE-RL", "Region"), + new("Samegrelo-Zemo Svaneti", "GE-SZ", "Region"), + new("Samtskhe-Javakheti", "GE-SJ", "Region"), + new("Shida Kartli", "GE-SK", "Region"), + + // Capital city + new("Tbilisi", "GE-TB", "City") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForGeorgia() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + GEORGIA_COUNTRY_NAME, + GEORGIA_OFFICIAL_NAME, + GEORGIA_NATIVE_NAME, + GEORGIA_CAPITAL, + GEORGIA_NUMERIC_CODE, + GEORGIA_ISO2_CODE, + GEORGIA_ISO3_CODE, + GEORGIA_CALLING_CODE, + EXPECTED_STATES + ); + } +} + diff --git a/src/World.Net/Countries/Georgia.cs b/src/World.Net/Countries/Georgia.cs new file mode 100644 index 0000000..5933010 --- /dev/null +++ b/src/World.Net/Countries/Georgia.cs @@ -0,0 +1,53 @@ +namespace World.Net.Countries; + +internal sealed class Georgia : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Georgia; + + // + public string Name { get; } = "Georgia"; + + // + public string OfficialName { get; } = "Georgia"; + + // + public string NativeName => "საქართველო"; + + // + public string Capital { get; } = "Tbilisi"; + + // + public int NumericCode { get; } = 268; + + // + public string ISO2Code { get; } = "GE"; + + // + public string ISO3Code { get; } = "GEO"; + + // + public string[] CallingCode { get; } = ["+995"]; + + // + public IEnumerable States => + [ + // Autonomous Republics + new("Abkhazia", "GE-AB", "Autonomous Republic"), + new("Adjara", "GE-AJ", "Autonomous Republic"), + + // Regions + new("Guria", "GE-GU", "Region"), + new("Imereti", "GE-IM", "Region"), + new("Kakheti", "GE-KA", "Region"), + new("Kvemo Kartli", "GE-KK", "Region"), + new("Mtskheta-Mtianeti", "GE-MM", "Region"), + new("Racha-Lechkhumi and Kvemo Svaneti", "GE-RL", "Region"), + new("Samegrelo-Zemo Svaneti", "GE-SZ", "Region"), + new("Samtskhe-Javakheti", "GE-SJ", "Region"), + new("Shida Kartli", "GE-SK", "Region"), + + // Capital city + new("Tbilisi", "GE-TB", "City") + ]; +} diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 69ed7d8..9fa2b7e 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -85,6 +85,7 @@ public static Dictionary Initialize() { CountryIdentifier.FrenchGuiana, new FrenchGuiana() }, { CountryIdentifier.FrenchPolynesia, new FrenchPolynesia() }, { CountryIdentifier.Gabon, new Gabon() }, + { CountryIdentifier.Georgia, new Georgia() }, { CountryIdentifier.Iraq, new Iraq() }, { CountryIdentifier.Ireland, new Ireland() }, { CountryIdentifier.Israel, new Israel() },