diff --git a/src/World.Net.UnitTests/Countries/GabonTest.cs b/src/World.Net.UnitTests/Countries/GabonTest.cs new file mode 100644 index 0000000..8315945 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/GabonTest.cs @@ -0,0 +1,50 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class GabonTest : AssertCountryTestBase +{ + private const string GABON_COUNTRY_NAME = "Gabon"; + private const string GABON_NATIVE_NAME = "Republique gabonaise"; + private const string GABON_CAPITAL = "Libreville"; + private const string GABON_OFFICIAL_NAME = "Gabonese Republic"; + private const string GABON_ISO2_CODE = "GA"; + private const string GABON_ISO3_CODE = "GAB"; + private const int GABON_NUMERIC_CODE = 266; + private readonly string[] GABON_CALLING_CODE = ["+241"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Gabon; + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Estuaire", "GA-1", "Province"), + new("Haut-Ogooue", "GA-2", "Province"), + new("Moyen-Ogooue", "GA-3", "Province"), + new("Ngounie", "GA-4", "Province"), + new("Nyanga", "GA-5", "Province"), + new("Ogooue-Ivindo", "GA-6", "Province"), + new("Ogooue-Lolo", "GA-7", "Province"), + new("Ogooue-Maritime", "GA-8", "Province"), + new("Woleu-Ntem", "GA-9", "Province") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForGabon() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + GABON_COUNTRY_NAME, + GABON_OFFICIAL_NAME, + GABON_NATIVE_NAME, + GABON_CAPITAL, + GABON_NUMERIC_CODE, + GABON_ISO2_CODE, + GABON_ISO3_CODE, + GABON_CALLING_CODE, + EXPECTED_STATES + ); + } +} + diff --git a/src/World.Net/Countries/Gabon.cs b/src/World.Net/Countries/Gabon.cs new file mode 100644 index 0000000..cf961cb --- /dev/null +++ b/src/World.Net/Countries/Gabon.cs @@ -0,0 +1,45 @@ +namespace World.Net.Countries; + +internal sealed class Gabon : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Gabon; + + // + public string Name { get; } = "Gabon"; + + // + public string OfficialName { get; } = "Gabonese Republic"; + + // + public string NativeName => "Republique gabonaise"; + + // + public string Capital { get; } = "Libreville"; + + // + public int NumericCode { get; } = 266; + + // + public string ISO2Code { get; } = "GA"; + + // + public string ISO3Code { get; } = "GAB"; + + // + public string[] CallingCode { get; } = ["+241"]; + + // + public IEnumerable States => + [ + new("Estuaire", "GA-1"), + new("Haut-Ogooue", "GA-2"), + new("Moyen-Ogooue", "GA-3"), + new("Ngounie", "GA-4"), + new("Nyanga", "GA-5"), + new("Ogooue-Ivindo", "GA-6"), + new("Ogooue-Lolo", "GA-7"), + new("Ogooue-Maritime", "GA-8"), + new("Woleu-Ntem", "GA-9") + ]; +} diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index e856a5f..69ed7d8 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -84,6 +84,7 @@ public static Dictionary Initialize() { CountryIdentifier.France, new France() }, { CountryIdentifier.FrenchGuiana, new FrenchGuiana() }, { CountryIdentifier.FrenchPolynesia, new FrenchPolynesia() }, + { CountryIdentifier.Gabon, new Gabon() }, { CountryIdentifier.Iraq, new Iraq() }, { CountryIdentifier.Ireland, new Ireland() }, { CountryIdentifier.Israel, new Israel() },