From e6a4051a3df8370b4a0735d0ef5a52d6df542657 Mon Sep 17 00:00:00 2001 From: IDAM Date: Thu, 18 Dec 2025 17:57:54 +0100 Subject: [PATCH 1/4] Nigeria, Niue, NorkfolkIsland, NorthernMarina, North Korea, North Macedonia, Norway --- .../Countries/NigeriaTest.cs | 78 +++++++++++++++++++ src/World.Net.UnitTests/Countries/NiueTest.cs | 56 +++++++++++++ .../Countries/NorfolkIslandTest.cs | 53 +++++++++++++ .../Countries/NorthKoreaTest.cs | 55 +++++++++++++ .../Countries/NorthMacedoniaTest.cs | 49 ++++++++++++ .../Countries/NorthernMarianaIslandsTest.cs | 45 +++++++++++ .../Countries/NorwayTest.cs | 52 +++++++++++++ src/World.Net/Countries/Nigeria.cs | 73 +++++++++++++++++ src/World.Net/Countries/Niue.cs | 51 ++++++++++++ src/World.Net/Countries/NorfolkIsland.cs | 47 +++++++++++ src/World.Net/Countries/NorthKorea.cs | 51 ++++++++++++ src/World.Net/Countries/NorthMacedonia.cs | 45 +++++++++++ .../Countries/NorthernMarianaIslands.cs | 40 ++++++++++ src/World.Net/Countries/Norway.cs | 48 ++++++++++++ 14 files changed, 743 insertions(+) create mode 100644 src/World.Net.UnitTests/Countries/NigeriaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NiueTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NorfolkIslandTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NorthKoreaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NorthMacedoniaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NorthernMarianaIslandsTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NorwayTest.cs create mode 100644 src/World.Net/Countries/Nigeria.cs create mode 100644 src/World.Net/Countries/Niue.cs create mode 100644 src/World.Net/Countries/NorfolkIsland.cs create mode 100644 src/World.Net/Countries/NorthKorea.cs create mode 100644 src/World.Net/Countries/NorthMacedonia.cs create mode 100644 src/World.Net/Countries/NorthernMarianaIslands.cs create mode 100644 src/World.Net/Countries/Norway.cs diff --git a/src/World.Net.UnitTests/Countries/NigeriaTest.cs b/src/World.Net.UnitTests/Countries/NigeriaTest.cs new file mode 100644 index 0000000..2e35f4c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NigeriaTest.cs @@ -0,0 +1,78 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NigeriaTest : AssertCountryTestBase +{ + private const string NIGERIA_COUNTRY_NAME = "Nigeria"; + private const string NIGERIA_NATIVE_NAME = "Nigeria"; + private const string NIGERIA_CAPITAL = "Abuja"; + private const string NIGERIA_OFFICIAL_NAME = "Federal Republic of Nigeria"; + private const string NIGERIA_ISO2_CODE = "NG"; + private const string NIGERIA_ISO3_CODE = "NGA"; + private const int NIGERIA_NUMERIC_CODE = 566; + private readonly string[] NIGERIA_CALLING_CODE = ["+234"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Nigeria; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Abia", "NG-AB", "State"), + new("Adamawa", "NG-AD", "State"), + new("Akwa Ibom", "NG-AK", "State"), + new("Anambra", "NG-AN", "State"), + new("Bauchi", "NG-BA", "State"), + new("Bayelsa", "NG-BY", "State"), + new("Benue", "NG-BE", "State"), + new("Borno", "NG-BO", "State"), + new("Cross River", "NG-CR", "State"), + new("Delta", "NG-DE", "State"), + new("Ebonyi", "NG-EB", "State"), + new("Edo", "NG-ED", "State"), + new("Ekiti", "NG-EK", "State"), + new("Enugu", "NG-EN", "State"), + new("Gombe", "NG-GO", "State"), + new("Imo", "NG-IM", "State"), + new("Jigawa", "NG-JI", "State"), + new("Kaduna", "NG-KD", "State"), + new("Kano", "NG-KN", "State"), + new("Katsina", "NG-KT", "State"), + new("Kebbi", "NG-KE", "State"), + new("Kogi", "NG-KO", "State"), + new("Kwara", "NG-KW", "State"), + new("Lagos", "NG-LA", "State"), + new("Nasarawa", "NG-NA", "State"), + new("Niger", "NG-NI", "State"), + new("Ogun", "NG-OG", "State"), + new("Ondo", "NG-ON", "State"), + new("Osun", "NG-OS", "State"), + new("Oyo", "NG-OY", "State"), + new("Plateau", "NG-PL", "State"), + new("Rivers", "NG-RI", "State"), + new("Sokoto", "NG-SO", "State"), + new("Taraba", "NG-TA", "State"), + new("Yobe", "NG-YO", "State"), + new("Zamfara", "NG-ZA", "State"), + new("Federal Capital Territory", "NG-FC", "Federal Capital Territory") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNigeria() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NIGERIA_COUNTRY_NAME, + NIGERIA_OFFICIAL_NAME, + NIGERIA_NATIVE_NAME, + NIGERIA_CAPITAL, + NIGERIA_NUMERIC_CODE, + NIGERIA_ISO2_CODE, + NIGERIA_ISO3_CODE, + NIGERIA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NiueTest.cs b/src/World.Net.UnitTests/Countries/NiueTest.cs new file mode 100644 index 0000000..44b91d5 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NiueTest.cs @@ -0,0 +1,56 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NiueTest : AssertCountryTestBase +{ + private const string NIUE_COUNTRY_NAME = "Niue"; + private const string NIUE_NATIVE_NAME = "Niuē"; + private const string NIUE_CAPITAL = "Alofi"; + private const string NIUE_OFFICIAL_NAME = "Niue"; + private const string NIUE_ISO2_CODE = "NU"; + private const string NIUE_ISO3_CODE = "NIU"; + private const int NIUE_NUMERIC_CODE = 570; + private readonly string[] NIUE_CALLING_CODE = ["+683"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Niue; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Alofi North", "NU-01", "Village"), + new("Alofi South", "NU-02", "Village"), + new("Avatele", "NU-03", "Village"), + new("Hakupu", "NU-04", "Village"), + new("Hikutavake", "NU-05", "Village"), + new("Lakepa", "NU-06", "Village"), + new("Liku", "NU-07", "Village"), + new("Makefu", "NU-08", "Village"), + new("Mutalau", "NU-09", "Village"), + new("Namukulu", "NU-10", "Village"), + new("Talava", "NU-11", "Village"), + new("Toi", "NU-12", "Village"), + new("Tufukia", "NU-13", "Village"), + new("Vaiea", "NU-14", "Village") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNiue() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NIUE_COUNTRY_NAME, + NIUE_OFFICIAL_NAME, + NIUE_NATIVE_NAME, + NIUE_CAPITAL, + NIUE_NUMERIC_CODE, + NIUE_ISO2_CODE, + NIUE_ISO3_CODE, + NIUE_CALLING_CODE, + EXPECTED_STATES + ); + } +} + diff --git a/src/World.Net.UnitTests/Countries/NorfolkIslandTest.cs b/src/World.Net.UnitTests/Countries/NorfolkIslandTest.cs new file mode 100644 index 0000000..b551696 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NorfolkIslandTest.cs @@ -0,0 +1,53 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NorfolkIslandTest : AssertCountryTestBase +{ + private const string NORFOLK_ISLAND_COUNTRY_NAME = "Norfolk Island"; + private const string NORFOLK_ISLAND_NATIVE_NAME = "Norfolk Island"; + private const string NORFOLK_ISLAND_CAPITAL = "Kingston"; + private const string NORFOLK_ISLAND_OFFICIAL_NAME = "Territory of Norfolk Island"; + private const string NORFOLK_ISLAND_ISO2_CODE = "NF"; + private const string NORFOLK_ISLAND_ISO3_CODE = "NFK"; + private const int NORFOLK_ISLAND_NUMERIC_CODE = 574; + private readonly string[] NORFOLK_ISLAND_CALLING_CODE = ["+672"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorfolkIsland; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Anson Bay", "NF-01", "Settlement"), + new("Ball Bay", "NF-02", "Settlement"), + new("Bicentennial", "NF-03", "Settlement"), + new("Burnt Pine", "NF-04", "Settlement"), + new("Cascade", "NF-05", "Settlement"), + new("Kingston", "NF-06", "Settlement"), + new("Longridge", "NF-07", "Settlement"), + new("Mount Pitt", "NF-08", "Settlement"), + new("Queen Elizabeth", "NF-09", "Settlement"), + new("Royal", "NF-10", "Settlement"), + new("Suffolk", "NF-11", "Settlement") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNorfolkIsland() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NORFOLK_ISLAND_COUNTRY_NAME, + NORFOLK_ISLAND_OFFICIAL_NAME, + NORFOLK_ISLAND_NATIVE_NAME, + NORFOLK_ISLAND_CAPITAL, + NORFOLK_ISLAND_NUMERIC_CODE, + NORFOLK_ISLAND_ISO2_CODE, + NORFOLK_ISLAND_ISO3_CODE, + NORFOLK_ISLAND_CALLING_CODE, + EXPECTED_STATES + ); + } +} + diff --git a/src/World.Net.UnitTests/Countries/NorthKoreaTest.cs b/src/World.Net.UnitTests/Countries/NorthKoreaTest.cs new file mode 100644 index 0000000..303e1e5 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NorthKoreaTest.cs @@ -0,0 +1,55 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NorthKoreaTest : AssertCountryTestBase +{ + private const string NORTH_KOREA_COUNTRY_NAME = "North Korea"; + private const string NORTH_KOREA_NATIVE_NAME = "조선민주주의인민공화국"; + private const string NORTH_KOREA_CAPITAL = "Pyongyang"; + private const string NORTH_KOREA_OFFICIAL_NAME = "Democratic People's Republic of Korea"; + private const string NORTH_KOREA_ISO2_CODE = "KP"; + private const string NORTH_KOREA_ISO3_CODE = "PRK"; + private const int NORTH_KOREA_NUMERIC_CODE = 408; + private readonly string[] NORTH_KOREA_CALLING_CODE = ["+850"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthKorea; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Chagang", "KP-CHA", "Province"), + new("North Hamgyong", "KP-HAMN", "Province"), + new("South Hamgyong", "KP-HAMS", "Province"), + new("North Hwanghae", "KP-HWAN", "Province"), + new("South Hwanghae", "KP-HWAS", "Province"), + new("Kangwon", "KP-KAN", "Province"), + new("North Pyongan", "KP-PYON", "Province"), + new("South Pyongan", "KP-PYOS", "Province"), + new("Ryanggang", "KP-RYA", "Province"), + new("Kaesong", "KP-KA", "Special City"), + new("Nampo", "KP-NAM", "Special City"), + new("Pyongyang", "KP-PY", "Directly Governed City"), + new("Rason", "KP-RAS", "Directly Governed City"), + new("Sinuiju", "KP-SIN", "Special City") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNorthKorea() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NORTH_KOREA_COUNTRY_NAME, + NORTH_KOREA_OFFICIAL_NAME, + NORTH_KOREA_NATIVE_NAME, + NORTH_KOREA_CAPITAL, + NORTH_KOREA_NUMERIC_CODE, + NORTH_KOREA_ISO2_CODE, + NORTH_KOREA_ISO3_CODE, + NORTH_KOREA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NorthMacedoniaTest.cs b/src/World.Net.UnitTests/Countries/NorthMacedoniaTest.cs new file mode 100644 index 0000000..ae16818 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NorthMacedoniaTest.cs @@ -0,0 +1,49 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NorthMacedoniaTest : AssertCountryTestBase +{ + private const string NORTH_MACEDONIA_COUNTRY_NAME = "North Macedonia"; + private const string NORTH_MACEDONIA_NATIVE_NAME = "Северна Македонија"; + private const string NORTH_MACEDONIA_CAPITAL = "Skopje"; + private const string NORTH_MACEDONIA_OFFICIAL_NAME = "Republic of North Macedonia"; + private const string NORTH_MACEDONIA_ISO2_CODE = "MK"; + private const string NORTH_MACEDONIA_ISO3_CODE = "MKD"; + private const int NORTH_MACEDONIA_NUMERIC_CODE = 807; + private readonly string[] NORTH_MACEDONIA_CALLING_CODE = ["+389"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthMacedonia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Eastern", "MK-01", "Region"), + new("North Eastern", "MK-02", "Region"), + new("Skopje", "MK-03", "Region"), + new("Pelagonia", "MK-04", "Region"), + new("Polog", "MK-05", "Region"), + new("South Eastern", "MK-06", "Region"), + new("South Western", "MK-07", "Region"), + new("Vardar", "MK-08", "Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNorthMacedonia() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NORTH_MACEDONIA_COUNTRY_NAME, + NORTH_MACEDONIA_OFFICIAL_NAME, + NORTH_MACEDONIA_NATIVE_NAME, + NORTH_MACEDONIA_CAPITAL, + NORTH_MACEDONIA_NUMERIC_CODE, + NORTH_MACEDONIA_ISO2_CODE, + NORTH_MACEDONIA_ISO3_CODE, + NORTH_MACEDONIA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NorthernMarianaIslandsTest.cs b/src/World.Net.UnitTests/Countries/NorthernMarianaIslandsTest.cs new file mode 100644 index 0000000..1846b82 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NorthernMarianaIslandsTest.cs @@ -0,0 +1,45 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NorthernMarianaIslandsTest : AssertCountryTestBase +{ + private const string NORTHERN_MARIANA_ISLANDS_COUNTRY_NAME = "Northern Mariana Islands"; + private const string NORTHERN_MARIANA_ISLANDS_NATIVE_NAME = "Northern Mariana Islands"; + private const string NORTHERN_MARIANA_ISLANDS_CAPITAL = "Saipan"; + private const string NORTHERN_MARIANA_ISLANDS_OFFICIAL_NAME = "Commonwealth of the Northern Mariana Islands"; + private const string NORTHERN_MARIANA_ISLANDS_ISO2_CODE = "MP"; + private const string NORTHERN_MARIANA_ISLANDS_ISO3_CODE = "MNP"; + private const int NORTHERN_MARIANA_ISLANDS_NUMERIC_CODE = 580; + private readonly string[] NORTHERN_MARIANA_ISLANDS_CALLING_CODE = ["+1-670"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthernMarianaIslands; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Saipan", "MP-SA", "Municipality"), + new("Tinian", "MP-TI", "Municipality"), + new("Rota", "MP-RO", "Municipality"), + new("Northern Islands", "MP-NI", "Municipality") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNorthernMarianaIslands() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NORTHERN_MARIANA_ISLANDS_COUNTRY_NAME, + NORTHERN_MARIANA_ISLANDS_OFFICIAL_NAME, + NORTHERN_MARIANA_ISLANDS_NATIVE_NAME, + NORTHERN_MARIANA_ISLANDS_CAPITAL, + NORTHERN_MARIANA_ISLANDS_NUMERIC_CODE, + NORTHERN_MARIANA_ISLANDS_ISO2_CODE, + NORTHERN_MARIANA_ISLANDS_ISO3_CODE, + NORTHERN_MARIANA_ISLANDS_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NorwayTest.cs b/src/World.Net.UnitTests/Countries/NorwayTest.cs new file mode 100644 index 0000000..eff752c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NorwayTest.cs @@ -0,0 +1,52 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NorwayTest : AssertCountryTestBase +{ + private const string NORWAY_COUNTRY_NAME = "Norway"; + private const string NORWAY_NATIVE_NAME = "Norge"; + private const string NORWAY_CAPITAL = "Oslo"; + private const string NORWAY_OFFICIAL_NAME = "Kingdom of Norway"; + private const string NORWAY_ISO2_CODE = "NO"; + private const string NORWAY_ISO3_CODE = "NOR"; + private const int NORWAY_NUMERIC_CODE = 578; + private readonly string[] NORWAY_CALLING_CODE = ["+47"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Norway; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Agder", "NO-01", "County"), + new("Innlandet", "NO-02", "County"), + new("Møre og Romsdal", "NO-03", "County"), + new("Nordland", "NO-04", "County"), + new("Oslo", "NO-05", "County"), + new("Rogaland", "NO-06", "County"), + new("Troms og Finnmark", "NO-07", "County"), + new("Trøndelag", "NO-08", "County"), + new("Vestfold og Telemark", "NO-09", "County"), + new("Vestland", "NO-10", "County"), + new("Viken", "NO-11", "County") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNorway() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + NORWAY_COUNTRY_NAME, + NORWAY_OFFICIAL_NAME, + NORWAY_NATIVE_NAME, + NORWAY_CAPITAL, + NORWAY_NUMERIC_CODE, + NORWAY_ISO2_CODE, + NORWAY_ISO3_CODE, + NORWAY_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net/Countries/Nigeria.cs b/src/World.Net/Countries/Nigeria.cs new file mode 100644 index 0000000..294e58d --- /dev/null +++ b/src/World.Net/Countries/Nigeria.cs @@ -0,0 +1,73 @@ +namespace World.Net.Countries; + +internal sealed class Nigeria : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Nigeria; + + // + public string Name { get; } = "Nigeria"; + + // + public string OfficialName { get; } = "Federal Republic of Nigeria"; + + // + public string NativeName => "Nigeria"; + + // + public string Capital { get; } = "Abuja"; + + // + public int NumericCode { get; } = 566; + + // + public string ISO2Code { get; } = "NG"; + + // + public string ISO3Code { get; } = "NGA"; + + // + public string[] CallingCode { get; } = ["+234"]; + + // + public IEnumerable States => + [ + new("Abia", "NG-AB", "State"), + new("Adamawa", "NG-AD", "State"), + new("Akwa Ibom", "NG-AK", "State"), + new("Anambra", "NG-AN", "State"), + new("Bauchi", "NG-BA", "State"), + new("Bayelsa", "NG-BY", "State"), + new("Benue", "NG-BE", "State"), + new("Borno", "NG-BO", "State"), + new("Cross River", "NG-CR", "State"), + new("Delta", "NG-DE", "State"), + new("Ebonyi", "NG-EB", "State"), + new("Edo", "NG-ED", "State"), + new("Ekiti", "NG-EK", "State"), + new("Enugu", "NG-EN", "State"), + new("Gombe", "NG-GO", "State"), + new("Imo", "NG-IM", "State"), + new("Jigawa", "NG-JI", "State"), + new("Kaduna", "NG-KD", "State"), + new("Kano", "NG-KN", "State"), + new("Katsina", "NG-KT", "State"), + new("Kebbi", "NG-KE", "State"), + new("Kogi", "NG-KO", "State"), + new("Kwara", "NG-KW", "State"), + new("Lagos", "NG-LA", "State"), + new("Nasarawa", "NG-NA", "State"), + new("Niger", "NG-NI", "State"), + new("Ogun", "NG-OG", "State"), + new("Ondo", "NG-ON", "State"), + new("Osun", "NG-OS", "State"), + new("Oyo", "NG-OY", "State"), + new("Plateau", "NG-PL", "State"), + new("Rivers", "NG-RI", "State"), + new("Sokoto", "NG-SO", "State"), + new("Taraba", "NG-TA", "State"), + new("Yobe", "NG-YO", "State"), + new("Zamfara", "NG-ZA", "State"), + new("Federal Capital Territory", "NG-FC", "Federal Capital Territory") + ]; +} diff --git a/src/World.Net/Countries/Niue.cs b/src/World.Net/Countries/Niue.cs new file mode 100644 index 0000000..3cb8df8 --- /dev/null +++ b/src/World.Net/Countries/Niue.cs @@ -0,0 +1,51 @@ +namespace World.Net.Countries; + +internal sealed class Niue : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Niue; + + // + public string Name { get; } = "Niue"; + + // + public string OfficialName { get; } = "Niue"; + + // + public string NativeName => "Niuē"; + + // + public string Capital { get; } = "Alofi"; + + // + public int NumericCode { get; } = 570; + + // + public string ISO2Code { get; } = "NU"; + + // + public string ISO3Code { get; } = "NIU"; + + // + public string[] CallingCode { get; } = ["+683"]; + + // + public IEnumerable States => + [ + new("Alofi North", "NU-01", "Village"), + new("Alofi South", "NU-02", "Village"), + new("Avatele", "NU-03", "Village"), + new("Hakupu", "NU-04", "Village"), + new("Hikutavake", "NU-05", "Village"), + new("Lakepa", "NU-06", "Village"), + new("Liku", "NU-07", "Village"), + new("Makefu", "NU-08", "Village"), + new("Mutalau", "NU-09", "Village"), + new("Namukulu", "NU-10", "Village"), + new("Talava", "NU-11", "Village"), + new("Toi", "NU-12", "Village"), + new("Tufukia", "NU-13", "Village"), + new("Vaiea", "NU-14", "Village") + ]; +} + diff --git a/src/World.Net/Countries/NorfolkIsland.cs b/src/World.Net/Countries/NorfolkIsland.cs new file mode 100644 index 0000000..bb2a7ab --- /dev/null +++ b/src/World.Net/Countries/NorfolkIsland.cs @@ -0,0 +1,47 @@ +namespace World.Net.Countries; + +internal sealed class NorfolkIsland : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.NorfolkIsland; + + // + public string Name { get; } = "Norfolk Island"; + + // + public string OfficialName { get; } = "Territory of Norfolk Island"; + + // + public string NativeName => "Norfolk Island"; + + // + public string Capital { get; } = "Kingston"; + + // + public int NumericCode { get; } = 574; + + // + public string ISO2Code { get; } = "NF"; + + // + public string ISO3Code { get; } = "NFK"; + + // + public string[] CallingCode { get; } = ["+672"]; + + // + public IEnumerable States => + [ + new("Anson Bay", "NF-01", "Settlement"), + new("Ball Bay", "NF-02", "Settlement"), + new("Bicentennial", "NF-03", "Settlement"), + new("Burnt Pine", "NF-04", "Settlement"), + new("Cascade", "NF-05", "Settlement"), + new("Kingston", "NF-06", "Settlement"), + new("Longridge", "NF-07", "Settlement"), + new("Mount Pitt", "NF-08", "Settlement"), + new("Queen Elizabeth", "NF-09", "Settlement"), + new("Royal", "NF-10", "Settlement"), + new("Suffolk", "NF-11", "Settlement") + ]; +} diff --git a/src/World.Net/Countries/NorthKorea.cs b/src/World.Net/Countries/NorthKorea.cs new file mode 100644 index 0000000..532aa35 --- /dev/null +++ b/src/World.Net/Countries/NorthKorea.cs @@ -0,0 +1,51 @@ +namespace World.Net.Countries; + +internal sealed class NorthKorea : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.NorthKorea; + + // + public string Name { get; } = "North Korea"; + + // + public string OfficialName { get; } = "Democratic People's Republic of Korea"; + + // + public string NativeName => "조선민주주의인민공화국"; + + // + public string Capital { get; } = "Pyongyang"; + + // + public int NumericCode { get; } = 408; + + // + public string ISO2Code { get; } = "KP"; + + // + public string ISO3Code { get; } = "PRK"; + + // + public string[] CallingCode { get; } = ["+850"]; + + // + public IEnumerable States => + [ + new("Chagang", "KP-CHA", "Province"), + new("North Hamgyong", "KP-HAMN", "Province"), + new("South Hamgyong", "KP-HAMS", "Province"), + new("North Hwanghae", "KP-HWAN", "Province"), + new("South Hwanghae", "KP-HWAS", "Province"), + new("Kangwon", "KP-KAN", "Province"), + new("North Pyongan", "KP-PYON", "Province"), + new("South Pyongan", "KP-PYOS", "Province"), + new("Ryanggang", "KP-RYA", "Province"), + new("Kaesong", "KP-KA", "Special City"), + new("Nampo", "KP-NAM", "Special City"), + new("Pyongyang", "KP-PY", "Directly Governed City"), + new("Rason", "KP-RAS", "Directly Governed City"), + new("Sinuiju", "KP-SIN", "Special City") + ]; +} + diff --git a/src/World.Net/Countries/NorthMacedonia.cs b/src/World.Net/Countries/NorthMacedonia.cs new file mode 100644 index 0000000..5d5368e --- /dev/null +++ b/src/World.Net/Countries/NorthMacedonia.cs @@ -0,0 +1,45 @@ +namespace World.Net.Countries; + +internal sealed class NorthMacedonia : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.NorthMacedonia; + + // + public string Name { get; } = "North Macedonia"; + + // + public string OfficialName { get; } = "Republic of North Macedonia"; + + // + public string NativeName => "Северна Македонија"; + + // + public string Capital { get; } = "Skopje"; + + // + public int NumericCode { get; } = 807; + + // + public string ISO2Code { get; } = "MK"; + + // + public string ISO3Code { get; } = "MKD"; + + // + public string[] CallingCode { get; } = ["+389"]; + + // + public IEnumerable States => + [ + new("Eastern", "MK-01", "Region"), + new("North Eastern", "MK-02", "Region"), + new("Skopje", "MK-03", "Region"), + new("Pelagonia", "MK-04", "Region"), + new("Polog", "MK-05", "Region"), + new("South Eastern", "MK-06", "Region"), + new("South Western", "MK-07", "Region"), + new("Vardar", "MK-08", "Region") + ]; +} + diff --git a/src/World.Net/Countries/NorthernMarianaIslands.cs b/src/World.Net/Countries/NorthernMarianaIslands.cs new file mode 100644 index 0000000..b93086f --- /dev/null +++ b/src/World.Net/Countries/NorthernMarianaIslands.cs @@ -0,0 +1,40 @@ +namespace World.Net.Countries; + +internal sealed class NorthernMarianaIslands : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.NorthernMarianaIslands; + + // + public string Name { get; } = "Northern Mariana Islands"; + + // + public string OfficialName { get; } = "Commonwealth of the Northern Mariana Islands"; + + // + public string NativeName => "Northern Mariana Islands"; + + // + public string Capital { get; } = "Saipan"; + + // + public int NumericCode { get; } = 580; + + // + public string ISO2Code { get; } = "MP"; + + // + public string ISO3Code { get; } = "MNP"; + + // + public string[] CallingCode { get; } = ["+1-670"]; + + // + public IEnumerable States => + [ + new("Saipan", "MP-SA", "Municipality"), + new("Tinian", "MP-TI", "Municipality"), + new("Rota", "MP-RO", "Municipality"), + new("Northern Islands", "MP-NI", "Municipality") + ]; +} diff --git a/src/World.Net/Countries/Norway.cs b/src/World.Net/Countries/Norway.cs new file mode 100644 index 0000000..5c5d510 --- /dev/null +++ b/src/World.Net/Countries/Norway.cs @@ -0,0 +1,48 @@ +namespace World.Net.Countries; + +internal sealed class Norway : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Norway; + + // + public string Name { get; } = "Norway"; + + // + public string OfficialName { get; } = "Kingdom of Norway"; + + // + public string NativeName => "Norge"; + + // + public string Capital { get; } = "Oslo"; + + // + public int NumericCode { get; } = 578; + + // + public string ISO2Code { get; } = "NO"; + + // + public string ISO3Code { get; } = "NOR"; + + // + public string[] CallingCode { get; } = ["+47"]; + + // + public IEnumerable States => + [ + new("Agder", "NO-01", "County"), + new("Innlandet", "NO-02", "County"), + new("Møre og Romsdal", "NO-03", "County"), + new("Nordland", "NO-04", "County"), + new("Oslo", "NO-05", "County"), + new("Rogaland", "NO-06", "County"), + new("Troms og Finnmark", "NO-07", "County"), + new("Trøndelag", "NO-08", "County"), + new("Vestfold og Telemark", "NO-09", "County"), + new("Vestland", "NO-10", "County"), + new("Viken", "NO-11", "County") + ]; +} + From 6b84d3299b73a88a10c912a98f8c48d08e641720 Mon Sep 17 00:00:00 2001 From: IDAM Date: Thu, 18 Dec 2025 18:04:18 +0100 Subject: [PATCH 2/4] country initializer updated --- src/World.Net/Helpers/CountryInitializer.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index f27693b..65d3f87 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -133,6 +133,13 @@ public static Dictionary Initialize() { CountryIdentifier.Luxembourg, new Luxembourg() }, { CountryIdentifier.MacauSAR, new MacauSAR() }, { CountryIdentifier.Madagascar, new Madagascar() }, + { CountryIdentifier.Nigeria, new Nigeria() }, + { CountryIdentifier.Niue, new Niue() }, + { CountryIdentifier.NorfolkIsland, new NorfolkIsland() }, + { CountryIdentifier.NorthKorea, new NorthKorea() }, + { CountryIdentifier.NorthMacedonia, new NorthMacedonia() }, + { CountryIdentifier.NorthernMarianaIslands, new NorthernMarianaIslands() }, + { CountryIdentifier.Norway, new Norway() }, // Future countries can be added here in the same format. }; From 5a799b48cd9f6aa2f3c94e0524330a35a67f76e3 Mon Sep 17 00:00:00 2001 From: IDAM Date: Thu, 18 Dec 2025 18:43:29 +0100 Subject: [PATCH 3/4] Add country classes and unit tests for multiple nations This commit introduces new country classes for Oman, Pakistan, Palau, Palestine, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Pitcairn Islands, Poland, Portugal, and Puerto Rico. Each class implements the `ICountry` interface, providing essential properties such as `Id`, `Name`, `OfficialName`, `NativeName`, `Capital`, `NumericCode`, `ISO2Code`, `ISO3Code`, `CallingCode`, and a list of `States`. Additionally, unit tests have been created to ensure the `CountryProvider.GetCountry` method returns accurate information for each country. --- src/World.Net.UnitTests/Countries/OmanTest.cs | 52 +++++++++++++++ .../Countries/PakistanTest.cs | 48 ++++++++++++++ .../Countries/PalauTest.cs | 57 ++++++++++++++++ .../Countries/PalestineTest.cs | 43 ++++++++++++ .../Countries/PanamaTest.cs | 60 +++++++++++++++++ .../Countries/PapuaNewGuineaTest.cs | 63 ++++++++++++++++++ .../Countries/ParaguayTest.cs | 59 +++++++++++++++++ src/World.Net.UnitTests/Countries/PeruTest.cs | 66 +++++++++++++++++++ .../Countries/PhilippinesTest.cs | 58 ++++++++++++++++ .../Countries/PitcairnIslandsTest.cs | 50 ++++++++++++++ .../Countries/PolandTest.cs | 57 ++++++++++++++++ .../Countries/PortugalTest.cs | 61 +++++++++++++++++ .../Countries/PuertoRicoTest.cs | 50 ++++++++++++++ src/World.Net/Countries/Oman.cs | 47 +++++++++++++ src/World.Net/Countries/Pakistan.cs | 44 +++++++++++++ src/World.Net/Countries/Palau.cs | 52 +++++++++++++++ src/World.Net/Countries/Palestine.cs | 38 +++++++++++ src/World.Net/Countries/Panama.cs | 49 ++++++++++++++ src/World.Net/Countries/PapuaNewGuinea.cs | 59 +++++++++++++++++ src/World.Net/Countries/Paraguay.cs | 55 ++++++++++++++++ src/World.Net/Countries/Peru.cs | 62 +++++++++++++++++ src/World.Net/Countries/Philippines.cs | 54 +++++++++++++++ src/World.Net/Countries/PitcairnIslands.cs | 38 +++++++++++ src/World.Net/Countries/Poland.cs | 52 +++++++++++++++ src/World.Net/Countries/Portugal.cs | 56 ++++++++++++++++ src/World.Net/Countries/PuertoRico.cs | 38 +++++++++++ src/World.Net/Helpers/CountryInitializer.cs | 17 ++++- 27 files changed, 1384 insertions(+), 1 deletion(-) create mode 100644 src/World.Net.UnitTests/Countries/OmanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PakistanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PalauTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PalestineTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PanamaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PapuaNewGuineaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/ParaguayTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PeruTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PhilippinesTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PitcairnIslandsTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PolandTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PortugalTest.cs create mode 100644 src/World.Net.UnitTests/Countries/PuertoRicoTest.cs create mode 100644 src/World.Net/Countries/Oman.cs create mode 100644 src/World.Net/Countries/Pakistan.cs create mode 100644 src/World.Net/Countries/Palau.cs create mode 100644 src/World.Net/Countries/Palestine.cs create mode 100644 src/World.Net/Countries/Panama.cs create mode 100644 src/World.Net/Countries/PapuaNewGuinea.cs create mode 100644 src/World.Net/Countries/Paraguay.cs create mode 100644 src/World.Net/Countries/Peru.cs create mode 100644 src/World.Net/Countries/Philippines.cs create mode 100644 src/World.Net/Countries/PitcairnIslands.cs create mode 100644 src/World.Net/Countries/Poland.cs create mode 100644 src/World.Net/Countries/Portugal.cs create mode 100644 src/World.Net/Countries/PuertoRico.cs diff --git a/src/World.Net.UnitTests/Countries/OmanTest.cs b/src/World.Net.UnitTests/Countries/OmanTest.cs new file mode 100644 index 0000000..7bf8bea --- /dev/null +++ b/src/World.Net.UnitTests/Countries/OmanTest.cs @@ -0,0 +1,52 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class OmanTest : AssertCountryTestBase +{ + private const string OMAN_COUNTRY_NAME = "Oman"; + private const string OMAN_NATIVE_NAME = "عُمان"; + private const string OMAN_CAPITAL = "Muscat"; + private const string OMAN_OFFICIAL_NAME = "Sultanate of Oman"; + private const string OMAN_ISO2_CODE = "OM"; + private const string OMAN_ISO3_CODE = "OMN"; + private const int OMAN_NUMERIC_CODE = 512; + private readonly string[] OMAN_CALLING_CODE = ["+968"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Oman; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Ad Dakhiliyah", "OM-DA", "Governorate"), + new("Ad Dhahirah", "OM-ZA", "Governorate"), + new("Al Batinah North", "OM-BN", "Governorate"), + new("Al Batinah South", "OM-BS", "Governorate"), + new("Al Wusta", "OM-WU", "Governorate"), + new("Ash Sharqiyah North", "OM-SH", "Governorate"), + new("Ash Sharqiyah South", "OM-SS", "Governorate"), + new("Dhofar", "OM-ZU", "Governorate"), + new("Muscat", "OM-MU", "Governorate"), + new("Musandam", "OM-MN", "Governorate"), + new("Al Buraimi", "OM-BR", "Governorate") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForOman() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + OMAN_COUNTRY_NAME, + OMAN_OFFICIAL_NAME, + OMAN_NATIVE_NAME, + OMAN_CAPITAL, + OMAN_NUMERIC_CODE, + OMAN_ISO2_CODE, + OMAN_ISO3_CODE, + OMAN_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PakistanTest.cs b/src/World.Net.UnitTests/Countries/PakistanTest.cs new file mode 100644 index 0000000..0abf9f9 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PakistanTest.cs @@ -0,0 +1,48 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PakistanTest : AssertCountryTestBase +{ + private const string PAKISTAN_COUNTRY_NAME = "Pakistan"; + private const string PAKISTAN_NATIVE_NAME = "پاکستان"; + private const string PAKISTAN_CAPITAL = "Islamabad"; + private const string PAKISTAN_OFFICIAL_NAME = "Islamic Republic of Pakistan"; + private const string PAKISTAN_ISO2_CODE = "PK"; + private const string PAKISTAN_ISO3_CODE = "PAK"; + private const int PAKISTAN_NUMERIC_CODE = 586; + private readonly string[] PAKISTAN_CALLING_CODE = ["+92"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Pakistan; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Balochistan", "PK-BA", "Province"), + new("Khyber Pakhtunkhwa", "PK-KP", "Province"), + new("Punjab", "PK-PB", "Province"), + new("Sindh", "PK-SD", "Province"), + new("Gilgit-Baltistan", "PK-GB", "Autonomous Territory"), + new("Azad Jammu and Kashmir", "PK-AJ", "Autonomous Territory"), + new("Islamabad Capital Territory", "PK-IS", "Federal Territory") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPakistan() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PAKISTAN_COUNTRY_NAME, + PAKISTAN_OFFICIAL_NAME, + PAKISTAN_NATIVE_NAME, + PAKISTAN_CAPITAL, + PAKISTAN_NUMERIC_CODE, + PAKISTAN_ISO2_CODE, + PAKISTAN_ISO3_CODE, + PAKISTAN_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PalauTest.cs b/src/World.Net.UnitTests/Countries/PalauTest.cs new file mode 100644 index 0000000..445a8ef --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PalauTest.cs @@ -0,0 +1,57 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PalauTest : AssertCountryTestBase +{ + private const string PALAU_COUNTRY_NAME = "Palau"; + private const string PALAU_NATIVE_NAME = "Belau"; + private const string PALAU_CAPITAL = "Ngerulmud"; + private const string PALAU_OFFICIAL_NAME = "Republic of Palau"; + private const string PALAU_ISO2_CODE = "PW"; + private const string PALAU_ISO3_CODE = "PLW"; + private const int PALAU_NUMERIC_CODE = 585; + private readonly string[] PALAU_CALLING_CODE = ["+680"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Palau; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Aimeliik", "PW-002", "State"), + new("Airai", "PW-004", "State"), + new("Angaur", "PW-010", "State"), + new("Hatohobei", "PW-050", "State"), + new("Kayangel", "PW-100", "State"), + new("Koror", "PW-150", "State"), + new("Melekeok", "PW-212", "State"), + new("Ngaraard", "PW-214", "State"), + new("Ngarchelong", "PW-218", "State"), + new("Ngardmau", "PW-222", "State"), + new("Ngatpang", "PW-224", "State"), + new("Ngchesar", "PW-226", "State"), + new("Ngeremlengui", "PW-227", "State"), + new("Ngiwal", "PW-228", "State"), + new("Peleliu", "PW-350", "State"), + new("Sonsorol", "PW-370", "State") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPalau() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PALAU_COUNTRY_NAME, + PALAU_OFFICIAL_NAME, + PALAU_NATIVE_NAME, + PALAU_CAPITAL, + PALAU_NUMERIC_CODE, + PALAU_ISO2_CODE, + PALAU_ISO3_CODE, + PALAU_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PalestineTest.cs b/src/World.Net.UnitTests/Countries/PalestineTest.cs new file mode 100644 index 0000000..3a0dad3 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PalestineTest.cs @@ -0,0 +1,43 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PalestineTest : AssertCountryTestBase +{ + private const string PALESTINE_COUNTRY_NAME = "Palestinian Territory, Occupied"; + private const string PALESTINE_NATIVE_NAME = "دولة فلسطين"; + private const string PALESTINE_CAPITAL = "Ramallah"; + private const string PALESTINE_OFFICIAL_NAME = "State of Palestine"; + private const string PALESTINE_ISO2_CODE = "PS"; + private const string PALESTINE_ISO3_CODE = "PSE"; + private const int PALESTINE_NUMERIC_CODE = 275; + private readonly string[] PALESTINE_CALLING_CODE = ["+970"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.PalestinianTerritoryOccupied; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Gaza", "PS-GA", "Governorate"), + new("West Bank", "PS-WB", "Governorate") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPalestine() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PALESTINE_COUNTRY_NAME, + PALESTINE_OFFICIAL_NAME, + PALESTINE_NATIVE_NAME, + PALESTINE_CAPITAL, + PALESTINE_NUMERIC_CODE, + PALESTINE_ISO2_CODE, + PALESTINE_ISO3_CODE, + PALESTINE_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PanamaTest.cs b/src/World.Net.UnitTests/Countries/PanamaTest.cs new file mode 100644 index 0000000..e2390e2 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PanamaTest.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries; + +public sealed class PanamaTest : AssertCountryTestBase +{ + private const string PANAMA_COUNTRY_NAME = "Panama"; + private const string PANAMA_NATIVE_NAME = "República de Panamá"; + private const string PANAMA_CAPITAL = "Panama City"; + private const string PANAMA_OFFICIAL_NAME = "Republic of Panama"; + private const string PANAMA_ISO2_CODE = "PA"; + private const string PANAMA_ISO3_CODE = "PAN"; + private const int PANAMA_NUMERIC_CODE = 591; + private readonly string[] PANAMA_CALLING_CODE = ["+507"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Panama; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Bocas del Toro", "PA-1", "Province"), + new("Chiriquí", "PA-4", "Province"), + new("Coclé", "PA-2", "Province"), + new("Colón", "PA-3", "Province"), + new("Darién", "PA-5", "Province"), + new("Herrera", "PA-6", "Province"), + new("Los Santos", "PA-7", "Province"), + new("Panamá", "PA-8", "Province"), + new("Veraguas", "PA-9", "Province"), + new("Panamá Oeste", "PA-10", "Province"), + new("Kuna Yala", "PA-KY", "Indigenous Region"), + new("Ngäbe-Buglé", "PA-NB", "Indigenous Region"), + new("Emberá-Wounaan", "PA-EM", "Indigenous Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPanama() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PANAMA_COUNTRY_NAME, + PANAMA_OFFICIAL_NAME, + PANAMA_NATIVE_NAME, + PANAMA_CAPITAL, + PANAMA_NUMERIC_CODE, + PANAMA_ISO2_CODE, + PANAMA_ISO3_CODE, + PANAMA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PapuaNewGuineaTest.cs b/src/World.Net.UnitTests/Countries/PapuaNewGuineaTest.cs new file mode 100644 index 0000000..39d517f --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PapuaNewGuineaTest.cs @@ -0,0 +1,63 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PapuaNewGuineaTest : AssertCountryTestBase +{ + private const string PNG_COUNTRY_NAME = "Papua New Guinea"; + private const string PNG_NATIVE_NAME = "Papua Niugini"; + private const string PNG_CAPITAL = "Port Moresby"; + private const string PNG_OFFICIAL_NAME = "Independent State of Papua New Guinea"; + private const string PNG_ISO2_CODE = "PG"; + private const string PNG_ISO3_CODE = "PNG"; + private const int PNG_NUMERIC_CODE = 598; + private readonly string[] PNG_CALLING_CODE = ["+675"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.PapuaNewGuinea; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Central", "PG-CN", "Province"), + new("Gulf", "PG-GL", "Province"), + new("Milne Bay", "PG-MB", "Province"), + new("Northern", "PG-NB", "Province"), + new("Southern Highlands", "PG-SH", "Province"), + new("Western", "PG-WP", "Province"), + new("Western Highlands", "PG-WH", "Province"), + new("Enga", "PG-EN", "Province"), + new("Eastern Highlands", "PG-EH", "Province"), + new("Hela", "PG-HE", "Province"), + new("Morobe", "PG-MO", "Province"), + new("Madang", "PG-MD", "Province"), + new("New Ireland", "PG-NI", "Province"), + new("East New Britain", "PG-EB", "Province"), + new("West New Britain", "PG-WB", "Province"), + new("Manus", "PG-MA", "Province"), + new("Bougainville", "PG-BA", "Autonomous Region"), + new("Chimbu", "PG-CP", "Province"), + new("Oro", "PG-OR", "Province"), + new("Sandaun", "PG-SO", "Province"), + new("Central", "PG-CE", "Province"), + new("National Capital District", "PG-NCD", "District") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPapuaNewGuinea() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PNG_COUNTRY_NAME, + PNG_OFFICIAL_NAME, + PNG_NATIVE_NAME, + PNG_CAPITAL, + PNG_NUMERIC_CODE, + PNG_ISO2_CODE, + PNG_ISO3_CODE, + PNG_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/ParaguayTest.cs b/src/World.Net.UnitTests/Countries/ParaguayTest.cs new file mode 100644 index 0000000..ff98ee3 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/ParaguayTest.cs @@ -0,0 +1,59 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class ParaguayTest : AssertCountryTestBase +{ + private const string PARAGUAY_COUNTRY_NAME = "Paraguay"; + private const string PARAGUAY_NATIVE_NAME = "República del Paraguay"; + private const string PARAGUAY_CAPITAL = "Asunción"; + private const string PARAGUAY_OFFICIAL_NAME = "Republic of Paraguay"; + private const string PARAGUAY_ISO2_CODE = "PY"; + private const string PARAGUAY_ISO3_CODE = "PRY"; + private const int PARAGUAY_NUMERIC_CODE = 600; + private readonly string[] PARAGUAY_CALLING_CODE = ["+595"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Paraguay; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Alto Paraguay", "PY-16", "Department"), + new("Alto Paraná", "PY-10", "Department"), + new("Amambay", "PY-13", "Department"), + new("Asunción", "PY-ASU", "Capital District"), + new("Boquerón", "PY-19", "Department"), + new("Caaguazú", "PY-5", "Department"), + new("Caazapá", "PY-6", "Department"), + new("Canindeyú", "PY-11", "Department"), + new("Central", "PY-15", "Department"), + new("Concepción", "PY-1", "Department"), + new("Cordillera", "PY-3", "Department"), + new("Guairá", "PY-4", "Department"), + new("Itapúa", "PY-7", "Department"), + new("Misiones", "PY-8", "Department"), + new("Ñeembucú", "PY-12", "Department"), + new("Paraguarí", "PY-9", "Department"), + new("Presidente Hayes", "PY-17", "Department"), + new("San Pedro", "PY-2", "Department") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForParaguay() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PARAGUAY_COUNTRY_NAME, + PARAGUAY_OFFICIAL_NAME, + PARAGUAY_NATIVE_NAME, + PARAGUAY_CAPITAL, + PARAGUAY_NUMERIC_CODE, + PARAGUAY_ISO2_CODE, + PARAGUAY_ISO3_CODE, + PARAGUAY_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PeruTest.cs b/src/World.Net.UnitTests/Countries/PeruTest.cs new file mode 100644 index 0000000..082efed --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PeruTest.cs @@ -0,0 +1,66 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PeruTest : AssertCountryTestBase +{ + private const string PERU_COUNTRY_NAME = "Peru"; + private const string PERU_NATIVE_NAME = "República del Perú"; + private const string PERU_CAPITAL = "Lima"; + private const string PERU_OFFICIAL_NAME = "Republic of Peru"; + private const string PERU_ISO2_CODE = "PE"; + private const string PERU_ISO3_CODE = "PER"; + private const int PERU_NUMERIC_CODE = 604; + private readonly string[] PERU_CALLING_CODE = ["+51"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Peru; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Amazonas", "PE-AMA", "Region"), + new("Áncash", "PE-ANC", "Region"), + new("Apurímac", "PE-APU", "Region"), + new("Arequipa", "PE-ARE", "Region"), + new("Ayacucho", "PE-AYA", "Region"), + new("Cajamarca", "PE-CAJ", "Region"), + new("Callao", "PE-CAL", "Constitutional Province"), + new("Cusco", "PE-CUS", "Region"), + new("Huancavelica", "PE-HUV", "Region"), + new("Huánuco", "PE-HUC", "Region"), + new("Ica", "PE-ICA", "Region"), + new("Junín", "PE-JUN", "Region"), + new("La Libertad", "PE-LAL", "Region"), + new("Lambayeque", "PE-LAM", "Region"), + new("Lima", "PE-LIM", "Region"), + new("Loreto", "PE-LOR", "Region"), + new("Madre de Dios", "PE-MDD", "Region"), + new("Moquegua", "PE-MOQ", "Region"), + new("Pasco", "PE-PAS", "Region"), + new("Piura", "PE-PIU", "Region"), + new("Puno", "PE-PUN", "Region"), + new("San Martín", "PE-SAM", "Region"), + new("Tacna", "PE-TAC", "Region"), + new("Tumbes", "PE-TUM", "Region"), + new("Ucayali", "PE-UCA", "Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPeru() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PERU_COUNTRY_NAME, + PERU_OFFICIAL_NAME, + PERU_NATIVE_NAME, + PERU_CAPITAL, + PERU_NUMERIC_CODE, + PERU_ISO2_CODE, + PERU_ISO3_CODE, + PERU_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PhilippinesTest.cs b/src/World.Net.UnitTests/Countries/PhilippinesTest.cs new file mode 100644 index 0000000..976d2f6 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PhilippinesTest.cs @@ -0,0 +1,58 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PhilippinesTest : AssertCountryTestBase +{ + private const string PH_COUNTRY_NAME = "Philippines"; + private const string PH_NATIVE_NAME = "Republika ng Pilipinas"; + private const string PH_CAPITAL = "Manila"; + private const string PH_OFFICIAL_NAME = "Republic of the Philippines"; + private const string PH_ISO2_CODE = "PH"; + private const string PH_ISO3_CODE = "PHL"; + private const int PH_NUMERIC_CODE = 608; + private readonly string[] PH_CALLING_CODE = ["+63"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Philippines; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Ilocos Region", "PH-01", "Region"), + new("Cagayan Valley", "PH-02", "Region"), + new("Central Luzon", "PH-03", "Region"), + new("CALABARZON", "PH-04", "Region"), + new("MIMAROPA", "PH-05", "Region"), + new("Bicol Region", "PH-06", "Region"), + new("Western Visayas", "PH-07", "Region"), + new("Central Visayas", "PH-08", "Region"), + new("Eastern Visayas", "PH-09", "Region"), + new("Zamboanga Peninsula", "PH-10", "Region"), + new("Northern Mindanao", "PH-11", "Region"), + new("Davao Region", "PH-12", "Region"), + new("SOCCSKSARGEN", "PH-13", "Region"), + new("Caraga", "PH-14", "Region"), + new("Bangsamoro Autonomous Region in Muslim Mindanao", "PH-15", "Autonomous Region"), + new("Cordillera Administrative Region", "PH-16", "Region"), + new("National Capital Region", "PH-NCR", "Capital Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPhilippines() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PH_COUNTRY_NAME, + PH_OFFICIAL_NAME, + PH_NATIVE_NAME, + PH_CAPITAL, + PH_NUMERIC_CODE, + PH_ISO2_CODE, + PH_ISO3_CODE, + PH_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PitcairnIslandsTest.cs b/src/World.Net.UnitTests/Countries/PitcairnIslandsTest.cs new file mode 100644 index 0000000..60c1ccb --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PitcairnIslandsTest.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class PitcairnIslandsTest : AssertCountryTestBase + { + private const string PITCAIRN_COUNTRY_NAME = "Pitcairn Islands"; + private const string PITCAIRN_NATIVE_NAME = "Pitcairn Islands"; + private const string PITCAIRN_CAPITAL = "Adamstown"; + private const string PITCAIRN_OFFICIAL_NAME = "Pitcairn, Henderson, Ducie and Oeno Islands"; + private const string PITCAIRN_ISO2_CODE = "PN"; + private const string PITCAIRN_ISO3_CODE = "PCN"; + private const int PITCAIRN_NUMERIC_CODE = 612; + private readonly string[] PITCAIRN_CALLING_CODE = ["+64"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.PitcairnIsland; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Pitcairn Island", "PN-PI", "Island") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPitcairnIslands() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PITCAIRN_COUNTRY_NAME, + PITCAIRN_OFFICIAL_NAME, + PITCAIRN_NATIVE_NAME, + PITCAIRN_CAPITAL, + PITCAIRN_NUMERIC_CODE, + PITCAIRN_ISO2_CODE, + PITCAIRN_ISO3_CODE, + PITCAIRN_CALLING_CODE, + EXPECTED_STATES + ); + } + } + +} diff --git a/src/World.Net.UnitTests/Countries/PolandTest.cs b/src/World.Net.UnitTests/Countries/PolandTest.cs new file mode 100644 index 0000000..970fd0a --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PolandTest.cs @@ -0,0 +1,57 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PolandTest : AssertCountryTestBase +{ + private const string POLAND_COUNTRY_NAME = "Poland"; + private const string POLAND_NATIVE_NAME = "Rzeczpospolita Polska"; + private const string POLAND_CAPITAL = "Warsaw"; + private const string POLAND_OFFICIAL_NAME = "Republic of Poland"; + private const string POLAND_ISO2_CODE = "PL"; + private const string POLAND_ISO3_CODE = "POL"; + private const int POLAND_NUMERIC_CODE = 616; + private readonly string[] POLAND_CALLING_CODE = ["+48"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Poland; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Greater Poland", "PL-WP", "Voivodeship"), + new("Kuyavian-Pomeranian", "PL-KP", "Voivodeship"), + new("Lesser Poland", "PL-MA", "Voivodeship"), + new("Łódź", "PL-LD", "Voivodeship"), + new("Lower Silesian", "PL-DS", "Voivodeship"), + new("Lublin", "PL-LU", "Voivodeship"), + new("Lubusz", "PL-LB", "Voivodeship"), + new("Masovian", "PL-MZ", "Voivodeship"), + new("Opole", "PL-OP", "Voivodeship"), + new("Podlaskie", "PL-PD", "Voivodeship"), + new("Pomeranian", "PL-PM", "Voivodeship"), + new("Silesian", "PL-SL", "Voivodeship"), + new("Subcarpathian", "PL-PK", "Voivodeship"), + new("Świętokrzyskie", "PL-SK", "Voivodeship"), + new("Warmian-Masurian", "PL-WN", "Voivodeship"), + new("West Pomeranian", "PL-ZP", "Voivodeship") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPoland() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + POLAND_COUNTRY_NAME, + POLAND_OFFICIAL_NAME, + POLAND_NATIVE_NAME, + POLAND_CAPITAL, + POLAND_NUMERIC_CODE, + POLAND_ISO2_CODE, + POLAND_ISO3_CODE, + POLAND_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PortugalTest.cs b/src/World.Net.UnitTests/Countries/PortugalTest.cs new file mode 100644 index 0000000..99e140b --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PortugalTest.cs @@ -0,0 +1,61 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class PortugalTest : AssertCountryTestBase +{ + private const string PORTUGAL_COUNTRY_NAME = "Portugal"; + private const string PORTUGAL_NATIVE_NAME = "República Portuguesa"; + private const string PORTUGAL_CAPITAL = "Lisbon"; + private const string PORTUGAL_OFFICIAL_NAME = "Portuguese Republic"; + private const string PORTUGAL_ISO2_CODE = "PT"; + private const string PORTUGAL_ISO3_CODE = "PRT"; + private const int PORTUGAL_NUMERIC_CODE = 620; + private readonly string[] PORTUGAL_CALLING_CODE = ["+351"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Portugal; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Aveiro", "PT-01", "District"), + new("Beja", "PT-02", "District"), + new("Braga", "PT-03", "District"), + new("Bragança", "PT-04", "District"), + new("Castelo Branco", "PT-05", "District"), + new("Coimbra", "PT-06", "District"), + new("Évora", "PT-07", "District"), + new("Faro", "PT-08", "District"), + new("Guarda", "PT-09", "District"), + new("Leiria", "PT-10", "District"), + new("Lisbon", "PT-11", "District"), + new("Portalegre", "PT-12", "District"), + new("Porto", "PT-13", "District"), + new("Santarém", "PT-14", "District"), + new("Setúbal", "PT-15", "District"), + new("Viana do Castelo", "PT-16", "District"), + new("Vila Real", "PT-17", "District"), + new("Viseu", "PT-18", "District"), + new("Azores", "PT-20", "Autonomous Region"), + new("Madeira", "PT-30", "Autonomous Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPortugal() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PORTUGAL_COUNTRY_NAME, + PORTUGAL_OFFICIAL_NAME, + PORTUGAL_NATIVE_NAME, + PORTUGAL_CAPITAL, + PORTUGAL_NUMERIC_CODE, + PORTUGAL_ISO2_CODE, + PORTUGAL_ISO3_CODE, + PORTUGAL_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/PuertoRicoTest.cs b/src/World.Net.UnitTests/Countries/PuertoRicoTest.cs new file mode 100644 index 0000000..e6dd730 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/PuertoRicoTest.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class PuertoRicoTest : AssertCountryTestBase + { + private const string PR_COUNTRY_NAME = "Puerto Rico"; + private const string PR_NATIVE_NAME = "Puerto Rico"; + private const string PR_CAPITAL = "San Juan"; + private const string PR_OFFICIAL_NAME = "Commonwealth of Puerto Rico"; + private const string PR_ISO2_CODE = "PR"; + private const string PR_ISO3_CODE = "PRI"; + private const int PR_NUMERIC_CODE = 630; + private readonly string[] PR_CALLING_CODE = ["+1-787", "+1-939"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.PuertoRico; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Puerto Rico", "PR-PR", "Territory") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForPuertoRico() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + PR_COUNTRY_NAME, + PR_OFFICIAL_NAME, + PR_NATIVE_NAME, + PR_CAPITAL, + PR_NUMERIC_CODE, + PR_ISO2_CODE, + PR_ISO3_CODE, + PR_CALLING_CODE, + EXPECTED_STATES + ); + } + } + +} diff --git a/src/World.Net/Countries/Oman.cs b/src/World.Net/Countries/Oman.cs new file mode 100644 index 0000000..c10d379 --- /dev/null +++ b/src/World.Net/Countries/Oman.cs @@ -0,0 +1,47 @@ +namespace World.Net.Countries; + +internal sealed class Oman : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Oman; + + // + public string Name { get; } = "Oman"; + + // + public string OfficialName { get; } = "Sultanate of Oman"; + + // + public string NativeName => "عُمان"; + + // + public string Capital { get; } = "Muscat"; + + // + public int NumericCode { get; } = 512; + + // + public string ISO2Code { get; } = "OM"; + + // + public string ISO3Code { get; } = "OMN"; + + // + public string[] CallingCode { get; } = ["+968"]; + + // + public IEnumerable States => + [ + new("Ad Dakhiliyah", "OM-DA", "Governorate"), + new("Ad Dhahirah", "OM-ZA", "Governorate"), + new("Al Batinah North", "OM-BN", "Governorate"), + new("Al Batinah South", "OM-BS", "Governorate"), + new("Al Wusta", "OM-WU", "Governorate"), + new("Ash Sharqiyah North", "OM-SH", "Governorate"), + new("Ash Sharqiyah South", "OM-SS", "Governorate"), + new("Dhofar", "OM-ZU", "Governorate"), + new("Muscat", "OM-MU", "Governorate"), + new("Musandam", "OM-MN", "Governorate"), + new("Al Buraimi", "OM-BR", "Governorate") + ]; +} diff --git a/src/World.Net/Countries/Pakistan.cs b/src/World.Net/Countries/Pakistan.cs new file mode 100644 index 0000000..71c8fb9 --- /dev/null +++ b/src/World.Net/Countries/Pakistan.cs @@ -0,0 +1,44 @@ +namespace World.Net.Countries; + +internal sealed class Pakistan : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Pakistan; + + // + public string Name { get; } = "Pakistan"; + + // + public string OfficialName { get; } = "Islamic Republic of Pakistan"; + + // + public string NativeName => "پاکستان"; + + // + public string Capital { get; } = "Islamabad"; + + // + public int NumericCode { get; } = 586; + + // + public string ISO2Code { get; } = "PK"; + + // + public string ISO3Code { get; } = "PAK"; + + // + public string[] CallingCode { get; } = ["+92"]; + + // + public IEnumerable States => + [ + new("Balochistan", "PK-BA", "Province"), + new("Khyber Pakhtunkhwa", "PK-KP", "Province"), + new("Punjab", "PK-PB", "Province"), + new("Sindh", "PK-SD", "Province"), + new("Gilgit-Baltistan", "PK-GB", "Autonomous Territory"), + new("Azad Jammu and Kashmir", "PK-AJ", "Autonomous Territory"), + new("Islamabad Capital Territory", "PK-IS", "Federal Territory") + ]; +} + diff --git a/src/World.Net/Countries/Palau.cs b/src/World.Net/Countries/Palau.cs new file mode 100644 index 0000000..6b8be98 --- /dev/null +++ b/src/World.Net/Countries/Palau.cs @@ -0,0 +1,52 @@ +namespace World.Net.Countries; + +internal sealed class Palau : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Palau; + + // + public string Name { get; } = "Palau"; + + // + public string OfficialName { get; } = "Republic of Palau"; + + // + public string NativeName => "Belau"; + + // + public string Capital { get; } = "Ngerulmud"; + + // + public int NumericCode { get; } = 585; + + // + public string ISO2Code { get; } = "PW"; + + // + public string ISO3Code { get; } = "PLW"; + + // + public string[] CallingCode { get; } = ["+680"]; + + // + public IEnumerable States => + [ + new("Aimeliik", "PW-002", "State"), + new("Airai", "PW-004", "State"), + new("Angaur", "PW-010", "State"), + new("Hatohobei", "PW-050", "State"), + new("Kayangel", "PW-100", "State"), + new("Koror", "PW-150", "State"), + new("Melekeok", "PW-212", "State"), + new("Ngaraard", "PW-214", "State"), + new("Ngarchelong", "PW-218", "State"), + new("Ngardmau", "PW-222", "State"), + new("Ngatpang", "PW-224", "State"), + new("Ngchesar", "PW-226", "State"), + new("Ngeremlengui", "PW-227", "State"), + new("Ngiwal", "PW-228", "State"), + new("Peleliu", "PW-350", "State"), + new("Sonsorol", "PW-370", "State") + ]; +} diff --git a/src/World.Net/Countries/Palestine.cs b/src/World.Net/Countries/Palestine.cs new file mode 100644 index 0000000..ca178eb --- /dev/null +++ b/src/World.Net/Countries/Palestine.cs @@ -0,0 +1,38 @@ +namespace World.Net.Countries; + +internal sealed class Palestine : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.PalestinianTerritoryOccupied; + + // + public string Name { get; } = "Palestinian Territory, Occupied"; + + // + public string OfficialName { get; } = "State of Palestine"; + + // + public string NativeName => "دولة فلسطين"; + + // + public string Capital { get; } = "Ramallah"; + + // + public int NumericCode { get; } = 275; + + // + public string ISO2Code { get; } = "PS"; + + // + public string ISO3Code { get; } = "PSE"; + + // + public string[] CallingCode { get; } = ["+970"]; + + // + public IEnumerable States => + [ + new("Gaza", "PS-GA", "Governorate"), + new("West Bank", "PS-WB", "Governorate") + ]; +} diff --git a/src/World.Net/Countries/Panama.cs b/src/World.Net/Countries/Panama.cs new file mode 100644 index 0000000..40e794c --- /dev/null +++ b/src/World.Net/Countries/Panama.cs @@ -0,0 +1,49 @@ +namespace World.Net.Countries; + +internal sealed class Panama : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Panama; + + // + public string Name { get; } = "Panama"; + + // + public string OfficialName { get; } = "Republic of Panama"; + + // + public string NativeName => "República de Panamá"; + + // + public string Capital { get; } = "Panama City"; + + // + public int NumericCode { get; } = 591; + + // + public string ISO2Code { get; } = "PA"; + + // + public string ISO3Code { get; } = "PAN"; + + // + public string[] CallingCode { get; } = ["+507"]; + + // + public IEnumerable States => + [ + new("Bocas del Toro", "PA-1", "Province"), + new("Chiriquí", "PA-4", "Province"), + new("Coclé", "PA-2", "Province"), + new("Colón", "PA-3", "Province"), + new("Darién", "PA-5", "Province"), + new("Herrera", "PA-6", "Province"), + new("Los Santos", "PA-7", "Province"), + new("Panamá", "PA-8", "Province"), + new("Veraguas", "PA-9", "Province"), + new("Panamá Oeste", "PA-10", "Province"), + new("Kuna Yala", "PA-KY", "Indigenous Region"), + new("Ngäbe-Buglé", "PA-NB", "Indigenous Region"), + new("Emberá-Wounaan", "PA-EM", "Indigenous Region") + ]; +} diff --git a/src/World.Net/Countries/PapuaNewGuinea.cs b/src/World.Net/Countries/PapuaNewGuinea.cs new file mode 100644 index 0000000..77fa44f --- /dev/null +++ b/src/World.Net/Countries/PapuaNewGuinea.cs @@ -0,0 +1,59 @@ +namespace World.Net.Countries; + +internal sealed class PapuaNewGuinea : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.PapuaNewGuinea; + + // + public string Name { get; } = "Papua New Guinea"; + + // + public string OfficialName { get; } = "Independent State of Papua New Guinea"; + + // + public string NativeName => "Papua Niugini"; + + // + public string Capital { get; } = "Port Moresby"; + + // + public int NumericCode { get; } = 598; + + // + public string ISO2Code { get; } = "PG"; + + // + public string ISO3Code { get; } = "PNG"; + + // + public string[] CallingCode { get; } = ["+675"]; + + // + public IEnumerable States => + [ + new("Central", "PG-CN", "Province"), + new("Gulf", "PG-GL", "Province"), + new("Milne Bay", "PG-MB", "Province"), + new("Northern", "PG-NB", "Province"), + new("Southern Highlands", "PG-SH", "Province"), + new("Western", "PG-WP", "Province"), + new("Western Highlands", "PG-WH", "Province"), + new("Enga", "PG-EN", "Province"), + new("Eastern Highlands", "PG-EH", "Province"), + new("Hela", "PG-HE", "Province"), + new("Morobe", "PG-MO", "Province"), + new("Madang", "PG-MD", "Province"), + new("New Ireland", "PG-NI", "Province"), + new("East New Britain", "PG-EB", "Province"), + new("West New Britain", "PG-WB", "Province"), + new("Manus", "PG-MA", "Province"), + new("Bougainville", "PG-BA", "Autonomous Region"), + new("Chimbu", "PG-CP", "Province"), + new("Oro", "PG-OR", "Province"), + new("Sandaun", "PG-SO", "Province"), + new("Central", "PG-CE", "Province"), + new("National Capital District", "PG-NCD", "District") + ]; +} + diff --git a/src/World.Net/Countries/Paraguay.cs b/src/World.Net/Countries/Paraguay.cs new file mode 100644 index 0000000..1be424d --- /dev/null +++ b/src/World.Net/Countries/Paraguay.cs @@ -0,0 +1,55 @@ +namespace World.Net.Countries; + +internal sealed class Paraguay : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Paraguay; + + // + public string Name { get; } = "Paraguay"; + + // + public string OfficialName { get; } = "Republic of Paraguay"; + + // + public string NativeName => "República del Paraguay"; + + // + public string Capital { get; } = "Asunción"; + + // + public int NumericCode { get; } = 600; + + // + public string ISO2Code { get; } = "PY"; + + // + public string ISO3Code { get; } = "PRY"; + + // + public string[] CallingCode { get; } = ["+595"]; + + // + public IEnumerable States => + [ + new("Alto Paraguay", "PY-16", "Department"), + new("Alto Paraná", "PY-10", "Department"), + new("Amambay", "PY-13", "Department"), + new("Asunción", "PY-ASU", "Capital District"), + new("Boquerón", "PY-19", "Department"), + new("Caaguazú", "PY-5", "Department"), + new("Caazapá", "PY-6", "Department"), + new("Canindeyú", "PY-11", "Department"), + new("Central", "PY-15", "Department"), + new("Concepción", "PY-1", "Department"), + new("Cordillera", "PY-3", "Department"), + new("Guairá", "PY-4", "Department"), + new("Itapúa", "PY-7", "Department"), + new("Misiones", "PY-8", "Department"), + new("Ñeembucú", "PY-12", "Department"), + new("Paraguarí", "PY-9", "Department"), + new("Presidente Hayes", "PY-17", "Department"), + new("San Pedro", "PY-2", "Department") + ]; +} + diff --git a/src/World.Net/Countries/Peru.cs b/src/World.Net/Countries/Peru.cs new file mode 100644 index 0000000..0b0529e --- /dev/null +++ b/src/World.Net/Countries/Peru.cs @@ -0,0 +1,62 @@ +namespace World.Net.Countries; + +internal sealed class Peru : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Peru; + + // + public string Name { get; } = "Peru"; + + // + public string OfficialName { get; } = "Republic of Peru"; + + // + public string NativeName => "República del Perú"; + + // + public string Capital { get; } = "Lima"; + + // + public int NumericCode { get; } = 604; + + // + public string ISO2Code { get; } = "PE"; + + // + public string ISO3Code { get; } = "PER"; + + // + public string[] CallingCode { get; } = ["+51"]; + + // + public IEnumerable States => + [ + new("Amazonas", "PE-AMA", "Region"), + new("Áncash", "PE-ANC", "Region"), + new("Apurímac", "PE-APU", "Region"), + new("Arequipa", "PE-ARE", "Region"), + new("Ayacucho", "PE-AYA", "Region"), + new("Cajamarca", "PE-CAJ", "Region"), + new("Callao", "PE-CAL", "Constitutional Province"), + new("Cusco", "PE-CUS", "Region"), + new("Huancavelica", "PE-HUV", "Region"), + new("Huánuco", "PE-HUC", "Region"), + new("Ica", "PE-ICA", "Region"), + new("Junín", "PE-JUN", "Region"), + new("La Libertad", "PE-LAL", "Region"), + new("Lambayeque", "PE-LAM", "Region"), + new("Lima", "PE-LIM", "Region"), + new("Loreto", "PE-LOR", "Region"), + new("Madre de Dios", "PE-MDD", "Region"), + new("Moquegua", "PE-MOQ", "Region"), + new("Pasco", "PE-PAS", "Region"), + new("Piura", "PE-PIU", "Region"), + new("Puno", "PE-PUN", "Region"), + new("San Martín", "PE-SAM", "Region"), + new("Tacna", "PE-TAC", "Region"), + new("Tumbes", "PE-TUM", "Region"), + new("Ucayali", "PE-UCA", "Region") + ]; +} + diff --git a/src/World.Net/Countries/Philippines.cs b/src/World.Net/Countries/Philippines.cs new file mode 100644 index 0000000..4cb4825 --- /dev/null +++ b/src/World.Net/Countries/Philippines.cs @@ -0,0 +1,54 @@ +namespace World.Net.Countries; + +internal sealed class Philippines : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Philippines; + + // + public string Name { get; } = "Philippines"; + + // + public string OfficialName { get; } = "Republic of the Philippines"; + + // + public string NativeName => "Republika ng Pilipinas"; + + // + public string Capital { get; } = "Manila"; + + // + public int NumericCode { get; } = 608; + + // + public string ISO2Code { get; } = "PH"; + + // + public string ISO3Code { get; } = "PHL"; + + // + public string[] CallingCode { get; } = ["+63"]; + + // + public IEnumerable States => + [ + new("Ilocos Region", "PH-01", "Region"), + new("Cagayan Valley", "PH-02", "Region"), + new("Central Luzon", "PH-03", "Region"), + new("CALABARZON", "PH-04", "Region"), + new("MIMAROPA", "PH-05", "Region"), + new("Bicol Region", "PH-06", "Region"), + new("Western Visayas", "PH-07", "Region"), + new("Central Visayas", "PH-08", "Region"), + new("Eastern Visayas", "PH-09", "Region"), + new("Zamboanga Peninsula", "PH-10", "Region"), + new("Northern Mindanao", "PH-11", "Region"), + new("Davao Region", "PH-12", "Region"), + new("SOCCSKSARGEN", "PH-13", "Region"), + new("Caraga", "PH-14", "Region"), + new("Bangsamoro Autonomous Region in Muslim Mindanao", "PH-15", "Autonomous Region"), + new("Cordillera Administrative Region", "PH-16", "Region"), + new("National Capital Region", "PH-NCR", "Capital Region") + ]; +} + diff --git a/src/World.Net/Countries/PitcairnIslands.cs b/src/World.Net/Countries/PitcairnIslands.cs new file mode 100644 index 0000000..83d8563 --- /dev/null +++ b/src/World.Net/Countries/PitcairnIslands.cs @@ -0,0 +1,38 @@ +namespace World.Net.Countries; + +internal sealed class PitcairnIslands : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.PitcairnIsland; + + // + public string Name { get; } = "Pitcairn Islands"; + + // + public string OfficialName { get; } = "Pitcairn, Henderson, Ducie and Oeno Islands"; + + // + public string NativeName => "Pitcairn Islands"; + + // + public string Capital { get; } = "Adamstown"; + + // + public int NumericCode { get; } = 612; + + // + public string ISO2Code { get; } = "PN"; + + // + public string ISO3Code { get; } = "PCN"; + + // + public string[] CallingCode { get; } = ["+64"]; + + // + public IEnumerable States => + [ + new("Pitcairn Island", "PN-PI", "Island") + ]; +} + diff --git a/src/World.Net/Countries/Poland.cs b/src/World.Net/Countries/Poland.cs new file mode 100644 index 0000000..5fb66b9 --- /dev/null +++ b/src/World.Net/Countries/Poland.cs @@ -0,0 +1,52 @@ +namespace World.Net.Countries; + +internal sealed class Poland : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Poland; + + // + public string Name { get; } = "Poland"; + + // + public string OfficialName { get; } = "Republic of Poland"; + + // + public string NativeName => "Rzeczpospolita Polska"; + + // + public string Capital { get; } = "Warsaw"; + + // + public int NumericCode { get; } = 616; + + // + public string ISO2Code { get; } = "PL"; + + // + public string ISO3Code { get; } = "POL"; + + // + public string[] CallingCode { get; } = ["+48"]; + + // + public IEnumerable States => + [ + new("Greater Poland", "PL-WP", "Voivodeship"), + new("Kuyavian-Pomeranian", "PL-KP", "Voivodeship"), + new("Lesser Poland", "PL-MA", "Voivodeship"), + new("Łódź", "PL-LD", "Voivodeship"), + new("Lower Silesian", "PL-DS", "Voivodeship"), + new("Lublin", "PL-LU", "Voivodeship"), + new("Lubusz", "PL-LB", "Voivodeship"), + new("Masovian", "PL-MZ", "Voivodeship"), + new("Opole", "PL-OP", "Voivodeship"), + new("Podlaskie", "PL-PD", "Voivodeship"), + new("Pomeranian", "PL-PM", "Voivodeship"), + new("Silesian", "PL-SL", "Voivodeship"), + new("Subcarpathian", "PL-PK", "Voivodeship"), + new("Świętokrzyskie", "PL-SK", "Voivodeship"), + new("Warmian-Masurian", "PL-WN", "Voivodeship"), + new("West Pomeranian", "PL-ZP", "Voivodeship") + ]; +} diff --git a/src/World.Net/Countries/Portugal.cs b/src/World.Net/Countries/Portugal.cs new file mode 100644 index 0000000..f6c4229 --- /dev/null +++ b/src/World.Net/Countries/Portugal.cs @@ -0,0 +1,56 @@ +namespace World.Net.Countries; + +internal sealed class Portugal : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Portugal; + + // + public string Name { get; } = "Portugal"; + + // + public string OfficialName { get; } = "Portuguese Republic"; + + // + public string NativeName => "República Portuguesa"; + + // + public string Capital { get; } = "Lisbon"; + + // + public int NumericCode { get; } = 620; + + // + public string ISO2Code { get; } = "PT"; + + // + public string ISO3Code { get; } = "PRT"; + + // + public string[] CallingCode { get; } = ["+351"]; + + // + public IEnumerable States => + [ + new("Aveiro", "PT-01", "District"), + new("Beja", "PT-02", "District"), + new("Braga", "PT-03", "District"), + new("Bragança", "PT-04", "District"), + new("Castelo Branco", "PT-05", "District"), + new("Coimbra", "PT-06", "District"), + new("Évora", "PT-07", "District"), + new("Faro", "PT-08", "District"), + new("Guarda", "PT-09", "District"), + new("Leiria", "PT-10", "District"), + new("Lisbon", "PT-11", "District"), + new("Portalegre", "PT-12", "District"), + new("Porto", "PT-13", "District"), + new("Santarém", "PT-14", "District"), + new("Setúbal", "PT-15", "District"), + new("Viana do Castelo", "PT-16", "District"), + new("Vila Real", "PT-17", "District"), + new("Viseu", "PT-18", "District"), + new("Azores", "PT-20", "Autonomous Region"), + new("Madeira", "PT-30", "Autonomous Region") + ]; +} diff --git a/src/World.Net/Countries/PuertoRico.cs b/src/World.Net/Countries/PuertoRico.cs new file mode 100644 index 0000000..db43e54 --- /dev/null +++ b/src/World.Net/Countries/PuertoRico.cs @@ -0,0 +1,38 @@ +namespace World.Net.Countries; + +internal sealed class PuertoRico : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.PuertoRico; + + // + public string Name { get; } = "Puerto Rico"; + + // + public string OfficialName { get; } = "Commonwealth of Puerto Rico"; + + // + public string NativeName => "Puerto Rico"; + + // + public string Capital { get; } = "San Juan"; + + // + public int NumericCode { get; } = 630; + + // + public string ISO2Code { get; } = "PR"; + + // + public string ISO3Code { get; } = "PRI"; + + // + public string[] CallingCode { get; } = ["+1-787", "+1-939"]; + + // + public IEnumerable States => + [ + new("Puerto Rico", "PR-PR", "Territory") + ]; +} + diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 65d3f87..fa2cfe5 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -1,4 +1,6 @@ -namespace World.Net.Helpers; +using World.Net.Countries; + +namespace World.Net.Helpers; internal sealed class CountryInitializer { @@ -140,6 +142,19 @@ public static Dictionary Initialize() { CountryIdentifier.NorthMacedonia, new NorthMacedonia() }, { CountryIdentifier.NorthernMarianaIslands, new NorthernMarianaIslands() }, { CountryIdentifier.Norway, new Norway() }, + { CountryIdentifier.Oman, new Oman() }, + { CountryIdentifier.Pakistan, new Pakistan() }, + { CountryIdentifier.Palau, new Palau() }, + { CountryIdentifier.PalestinianTerritoryOccupied, new Palestine() }, + { CountryIdentifier.Panama, new Panama() }, + { CountryIdentifier.PapuaNewGuinea, new PapuaNewGuinea() }, + { CountryIdentifier.Paraguay, new Paraguay() }, + { CountryIdentifier.Peru, new Peru() }, + { CountryIdentifier.Philippines, new Philippines() }, + { CountryIdentifier.PitcairnIsland, new PitcairnIslands() }, + { CountryIdentifier.Poland, new Poland() }, + { CountryIdentifier.Portugal, new Portugal() }, + { CountryIdentifier.PuertoRico, new PuertoRico() }, // Future countries can be added here in the same format. }; From 56655b4852cb4615c6818990d7cd124b8d26fc63 Mon Sep 17 00:00:00 2001 From: IDAM Date: Thu, 18 Dec 2025 19:07:10 +0100 Subject: [PATCH 4/4] Qatar to Rwanda --- .../Countries/QatarTest.cs | 57 ++++++++ .../Countries/ReunionTest.cs | 42 ++++++ .../Countries/RomaniaTest.cs | 83 ++++++++++++ .../Countries/RussiaTest.cs | 124 ++++++++++++++++++ .../Countries/RwandaTest.cs | 46 +++++++ src/World.Net/Countries/Qatar.cs | 45 +++++++ src/World.Net/Countries/Reunion.cs | 38 ++++++ src/World.Net/Countries/Romania.cs | 79 +++++++++++ src/World.Net/Countries/Russia.cs | 120 +++++++++++++++++ src/World.Net/Countries/Rwanda.cs | 42 ++++++ src/World.Net/Helpers/CountryInitializer.cs | 5 + 11 files changed, 681 insertions(+) create mode 100644 src/World.Net.UnitTests/Countries/QatarTest.cs create mode 100644 src/World.Net.UnitTests/Countries/ReunionTest.cs create mode 100644 src/World.Net.UnitTests/Countries/RomaniaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/RussiaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/RwandaTest.cs create mode 100644 src/World.Net/Countries/Qatar.cs create mode 100644 src/World.Net/Countries/Reunion.cs create mode 100644 src/World.Net/Countries/Romania.cs create mode 100644 src/World.Net/Countries/Russia.cs create mode 100644 src/World.Net/Countries/Rwanda.cs diff --git a/src/World.Net.UnitTests/Countries/QatarTest.cs b/src/World.Net.UnitTests/Countries/QatarTest.cs new file mode 100644 index 0000000..a46fb0b --- /dev/null +++ b/src/World.Net.UnitTests/Countries/QatarTest.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class QatarTest : AssertCountryTestBase + { + private const string QATAR_COUNTRY_NAME = "Qatar"; + private const string QATAR_NATIVE_NAME = "دولة قطر"; + private const string QATAR_CAPITAL = "Doha"; + private const string QATAR_OFFICIAL_NAME = "State of Qatar"; + private const string QATAR_ISO2_CODE = "QA"; + private const string QATAR_ISO3_CODE = "QAT"; + private const int QATAR_NUMERIC_CODE = 634; + private readonly string[] QATAR_CALLING_CODE = ["+974"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Qatar; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Ad Dawhah", "QA-DA", "Municipality"), + new("Al Khor", "QA-KH", "Municipality"), + new("Al Rayyan", "QA-RA", "Municipality"), + new("Al Shamal", "QA-SH", "Municipality"), + new("Al Wakrah", "QA-WA", "Municipality"), + new("Al Shahaniya", "QA-SN", "Municipality"), + new("Umm Salal", "QA-US", "Municipality"), + new("Al Daayen", "QA-DAA", "Municipality") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForQatar() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + QATAR_COUNTRY_NAME, + QATAR_OFFICIAL_NAME, + QATAR_NATIVE_NAME, + QATAR_CAPITAL, + QATAR_NUMERIC_CODE, + QATAR_ISO2_CODE, + QATAR_ISO3_CODE, + QATAR_CALLING_CODE, + EXPECTED_STATES + ); + } + } + +} diff --git a/src/World.Net.UnitTests/Countries/ReunionTest.cs b/src/World.Net.UnitTests/Countries/ReunionTest.cs new file mode 100644 index 0000000..3ecd78d --- /dev/null +++ b/src/World.Net.UnitTests/Countries/ReunionTest.cs @@ -0,0 +1,42 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class ReunionTest : AssertCountryTestBase +{ + private const string REUNION_COUNTRY_NAME = "Réunion"; + private const string REUNION_NATIVE_NAME = "Réunion"; + private const string REUNION_CAPITAL = "Saint-Denis"; + private const string REUNION_OFFICIAL_NAME = "Réunion"; + private const string REUNION_ISO2_CODE = "RE"; + private const string REUNION_ISO3_CODE = "REU"; + private const int REUNION_NUMERIC_CODE = 638; + private readonly string[] REUNION_CALLING_CODE = ["+262"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Reunion; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Réunion", "RE-RE", "Region") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForReunion() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + REUNION_COUNTRY_NAME, + REUNION_OFFICIAL_NAME, + REUNION_NATIVE_NAME, + REUNION_CAPITAL, + REUNION_NUMERIC_CODE, + REUNION_ISO2_CODE, + REUNION_ISO3_CODE, + REUNION_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/RomaniaTest.cs b/src/World.Net.UnitTests/Countries/RomaniaTest.cs new file mode 100644 index 0000000..bcbf25c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/RomaniaTest.cs @@ -0,0 +1,83 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class RomaniaTest : AssertCountryTestBase +{ + private const string ROMANIA_COUNTRY_NAME = "Romania"; + private const string ROMANIA_NATIVE_NAME = "România"; + private const string ROMANIA_CAPITAL = "Bucharest"; + private const string ROMANIA_OFFICIAL_NAME = "Romania"; + private const string ROMANIA_ISO2_CODE = "RO"; + private const string ROMANIA_ISO3_CODE = "ROU"; + private const int ROMANIA_NUMERIC_CODE = 642; + private readonly string[] ROMANIA_CALLING_CODE = ["+40"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Romania; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Alba", "RO-AB", "County"), + new("Arad", "RO-AR", "County"), + new("Argeș", "RO-AG", "County"), + new("Bacău", "RO-BC", "County"), + new("Bihor", "RO-BH", "County"), + new("Bistrița-Năsăud", "RO-BN", "County"), + new("Botoșani", "RO-BT", "County"), + new("Brașov", "RO-BV", "County"), + new("Brăila", "RO-BR", "County"), + new("Buzău", "RO-BZ", "County"), + new("Caraș-Severin", "RO-CS", "County"), + new("Călărași", "RO-CL", "County"), + new("Cluj", "RO-CJ", "County"), + new("Constanța", "RO-CT", "County"), + new("Covasna", "RO-CV", "County"), + new("Dâmbovița", "RO-DB", "County"), + new("Dolj", "RO-DJ", "County"), + new("Galați", "RO-GL", "County"), + new("Giurgiu", "RO-GR", "County"), + new("Gorj", "RO-GJ", "County"), + new("Harghita", "RO-HR", "County"), + new("Hunedoara", "RO-HD", "County"), + new("Ialomița", "RO-IL", "County"), + new("Iași", "RO-IS", "County"), + new("Ilfov", "RO-IF", "County"), + new("Maramureș", "RO-MM", "County"), + new("Mehedinți", "RO-MH", "County"), + new("Mureș", "RO-MS", "County"), + new("Neamț", "RO-NT", "County"), + new("Olt", "RO-OT", "County"), + new("Prahova", "RO-PH", "County"), + new("Satu Mare", "RO-SM", "County"), + new("Sălaj", "RO-SJ", "County"), + new("Sibiu", "RO-SB", "County"), + new("Suceava", "RO-SV", "County"), + new("Teleorman", "RO-TR", "County"), + new("Timiș", "RO-TM", "County"), + new("Tulcea", "RO-TL", "County"), + new("Vaslui", "RO-VS", "County"), + new("Vâlcea", "RO-VL", "County"), + new("Vrancea", "RO-VN", "County"), + new("Bucharest", "RO-B", "Municipality") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForRomania() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + ROMANIA_COUNTRY_NAME, + ROMANIA_OFFICIAL_NAME, + ROMANIA_NATIVE_NAME, + ROMANIA_CAPITAL, + ROMANIA_NUMERIC_CODE, + ROMANIA_ISO2_CODE, + ROMANIA_ISO3_CODE, + ROMANIA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/RussiaTest.cs b/src/World.Net.UnitTests/Countries/RussiaTest.cs new file mode 100644 index 0000000..8397704 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/RussiaTest.cs @@ -0,0 +1,124 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class RussiaTest : AssertCountryTestBase +{ + private const string RUSSIA_COUNTRY_NAME = "Russia"; + private const string RUSSIA_NATIVE_NAME = "Россия"; + private const string RUSSIA_CAPITAL = "Moscow"; + private const string RUSSIA_OFFICIAL_NAME = "Russian Federation"; + private const string RUSSIA_ISO2_CODE = "RU"; + private const string RUSSIA_ISO3_CODE = "RUS"; + private const int RUSSIA_NUMERIC_CODE = 643; + private readonly string[] RUSSIA_CALLING_CODE = ["+7"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Russia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Adygea", "RU-AD", "Federal Subject"), + new("Altai Republic", "RU-AL", "Federal Subject"), + new("Altai Krai", "RU-ALT", "Federal Subject"), + new("Amur Oblast", "RU-AMU", "Federal Subject"), + new("Arkhangelsk Oblast", "RU-ARK", "Federal Subject"), + new("Astrakhan Oblast", "RU-AST", "Federal Subject"), + new("Bashkortostan", "RU-BA", "Federal Subject"), + new("Belgorod Oblast", "RU-BEL", "Federal Subject"), + new("Bryansk Oblast", "RU-BRY", "Federal Subject"), + new("Buryatia", "RU-BU", "Federal Subject"), + new("Chechnya", "RU-CE", "Federal Subject"), + new("Chelyabinsk Oblast", "RU-CHE", "Federal Subject"), + new("Chukotka", "RU-CHU", "Federal Subject"), + new("Chuvashia", "RU-CU", "Federal Subject"), + new("Dagestan", "RU-DA", "Federal Subject"), + new("Ingushetia", "RU-IN", "Federal Subject"), + new("Irkutsk Oblast", "RU-IRK", "Federal Subject"), + new("Ivanovo Oblast", "RU-IVA", "Federal Subject"), + new("Jewish Autonomous Oblast", "RU-YEV", "Federal Subject"), + new("Kabardino-Balkaria", "RU-KB", "Federal Subject"), + new("Kaliningrad Oblast", "RU-KGD", "Federal Subject"), + new("Kalmykia", "RU-KL", "Federal Subject"), + new("Kaluga Oblast", "RU-KLU", "Federal Subject"), + new("Kamchatka Krai", "RU-KAM", "Federal Subject"), + new("Karachay-Cherkessia", "RU-KC", "Federal Subject"), + new("Karelia", "RU-KR", "Federal Subject"), + new("Kemerovo Oblast", "RU-KEM", "Federal Subject"), + new("Khabarovsk Krai", "RU-KHA", "Federal Subject"), + new("Khakassia", "RU-KK", "Federal Subject"), + new("Khanty-Mansi Autonomous Okrug", "RU-KHM", "Federal Subject"), + new("Kirov Oblast", "RU-KIR", "Federal Subject"), + new("Komi", "RU-KO", "Federal Subject"), + new("Kostroma Oblast", "RU-KOS", "Federal Subject"), + new("Krasnodar Krai", "RU-KDA", "Federal Subject"), + new("Krasnoyarsk Krai", "RU-KYA", "Federal Subject"), + new("Kurgan Oblast", "RU-KUR", "Federal Subject"), + new("Kursk Oblast", "RU-KRS", "Federal Subject"), + new("Leningrad Oblast", "RU-LEN", "Federal Subject"), + new("Lipetsk Oblast", "RU-LIP", "Federal Subject"), + new("Magadan Oblast", "RU-MAG", "Federal Subject"), + new("Mari El", "RU-ME", "Federal Subject"), + new("Mordovia", "RU-MO", "Federal Subject"), + new("Moscow", "RU-MOS", "Federal Subject"), + new("Moscow Oblast", "RU-MOW", "Federal Subject"), + new("Murmansk Oblast", "RU-MUR", "Federal Subject"), + new("Nenets Autonomous Okrug", "RU-NEN", "Federal Subject"), + new("Nizhny Novgorod Oblast", "RU-NIZ", "Federal Subject"), + new("North Ossetia–Alania", "RU-SE", "Federal Subject"), + new("Novgorod Oblast", "RU-NGR", "Federal Subject"), + new("Novosibirsk Oblast", "RU-NVS", "Federal Subject"), + new("Omsk Oblast", "RU-OMS", "Federal Subject"), + new("Orenburg Oblast", "RU-ORE", "Federal Subject"), + new("Oryol Oblast", "RU-ORL", "Federal Subject"), + new("Penza Oblast", "RU-PNZ", "Federal Subject"), + new("Perm Krai", "RU-PER", "Federal Subject"), + new("Primorsky Krai", "RU-PRI", "Federal Subject"), + new("Pskov Oblast", "RU-PSK", "Federal Subject"), + new("Rostov Oblast", "RU-ROS", "Federal Subject"), + new("Ryazan Oblast", "RU-RYA", "Federal Subject"), + new("Saint Petersburg", "RU-SPE", "Federal Subject"), + new("Sakha Republic (Yakutia)", "RU-SAK", "Federal Subject"), + new("Sakhalin Oblast", "RU-SAKH", "Federal Subject"), + new("Samara Oblast", "RU-SAM", "Federal Subject"), + new("Saratov Oblast", "RU-SAR", "Federal Subject"), + new("Smolensk Oblast", "RU-SMO", "Federal Subject"), + new("Stavropol Krai", "RU-STA", "Federal Subject"), + new("Sverdlovsk Oblast", "RU-SVE", "Federal Subject"), + new("Tambov Oblast", "RU-TAM", "Federal Subject"), + new("Tatarstan", "RU-TA", "Federal Subject"), + new("Tomsk Oblast", "RU-TOM", "Federal Subject"), + new("Tula Oblast", "RU-TUL", "Federal Subject"), + new("Tuva", "RU-TY", "Federal Subject"), + new("Tver Oblast", "RU-TVE", "Federal Subject"), + new("Tyumen Oblast", "RU-TYU", "Federal Subject"), + new("Udmurtia", "RU-UD", "Federal Subject"), + new("Ulyanovsk Oblast", "RU-ULY", "Federal Subject"), + new("Vladimir Oblast", "RU-VLA", "Federal Subject"), + new("Volgograd Oblast", "RU-VGG", "Federal Subject"), + new("Vologda Oblast", "RU-VLG", "Federal Subject"), + new("Voronezh Oblast", "RU-VOR", "Federal Subject"), + new("Yamalo-Nenets Autonomous Okrug", "RU-YAN", "Federal Subject"), + new("Yaroslavl Oblast", "RU-YAR", "Federal Subject"), + new("Zabaykalsky Krai", "RU-ZAB", "Federal Subject") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForRussia() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + RUSSIA_COUNTRY_NAME, + RUSSIA_OFFICIAL_NAME, + RUSSIA_NATIVE_NAME, + RUSSIA_CAPITAL, + RUSSIA_NUMERIC_CODE, + RUSSIA_ISO2_CODE, + RUSSIA_ISO3_CODE, + RUSSIA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/RwandaTest.cs b/src/World.Net.UnitTests/Countries/RwandaTest.cs new file mode 100644 index 0000000..8e883b5 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/RwandaTest.cs @@ -0,0 +1,46 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class RwandaTest : AssertCountryTestBase +{ + private const string RWANDA_COUNTRY_NAME = "Rwanda"; + private const string RWANDA_NATIVE_NAME = "Rwanda"; + private const string RWANDA_CAPITAL = "Kigali"; + private const string RWANDA_OFFICIAL_NAME = "Republic of Rwanda"; + private const string RWANDA_ISO2_CODE = "RW"; + private const string RWANDA_ISO3_CODE = "RWA"; + private const int RWANDA_NUMERIC_CODE = 646; + private readonly string[] RWANDA_CALLING_CODE = ["+250"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Rwanda; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + [ + new("Kigali", "RW-KI", "Province"), + new("Eastern", "RW-ES", "Province"), + new("Northern", "RW-NO", "Province"), + new("Western", "RW-WE", "Province"), + new("Southern", "RW-SO", "Province") + ]; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForRwanda() + { + // Arrange + // Act + var country = CountryProvider.GetCountry(EXPECTEDID); + + // Assert + AssertCorrectInformation( + country, + EXPECTEDID, + RWANDA_COUNTRY_NAME, + RWANDA_OFFICIAL_NAME, + RWANDA_NATIVE_NAME, + RWANDA_CAPITAL, + RWANDA_NUMERIC_CODE, + RWANDA_ISO2_CODE, + RWANDA_ISO3_CODE, + RWANDA_CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net/Countries/Qatar.cs b/src/World.Net/Countries/Qatar.cs new file mode 100644 index 0000000..1b8f830 --- /dev/null +++ b/src/World.Net/Countries/Qatar.cs @@ -0,0 +1,45 @@ +namespace World.Net.Countries; + +internal sealed class Qatar : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Qatar; + + // + public string Name { get; } = "Qatar"; + + // + public string OfficialName { get; } = "State of Qatar"; + + // + public string NativeName => "دولة قطر"; + + // + public string Capital { get; } = "Doha"; + + // + public int NumericCode { get; } = 634; + + // + public string ISO2Code { get; } = "QA"; + + // + public string ISO3Code { get; } = "QAT"; + + // + public string[] CallingCode { get; } = ["+974"]; + + // + public IEnumerable States => + [ + new("Ad Dawhah", "QA-DA", "Municipality"), + new("Al Khor", "QA-KH", "Municipality"), + new("Al Rayyan", "QA-RA", "Municipality"), + new("Al Shamal", "QA-SH", "Municipality"), + new("Al Wakrah", "QA-WA", "Municipality"), + new("Al Shahaniya", "QA-SN", "Municipality"), + new("Umm Salal", "QA-US", "Municipality"), + new("Al Daayen", "QA-DAA", "Municipality") + ]; +} + diff --git a/src/World.Net/Countries/Reunion.cs b/src/World.Net/Countries/Reunion.cs new file mode 100644 index 0000000..cac061b --- /dev/null +++ b/src/World.Net/Countries/Reunion.cs @@ -0,0 +1,38 @@ +namespace World.Net.Countries; + +internal sealed class Reunion : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Reunion; + + // + public string Name { get; } = "Réunion"; + + // + public string OfficialName { get; } = "Réunion"; + + // + public string NativeName => "Réunion"; + + // + public string Capital { get; } = "Saint-Denis"; + + // + public int NumericCode { get; } = 638; + + // + public string ISO2Code { get; } = "RE"; + + // + public string ISO3Code { get; } = "REU"; + + // + public string[] CallingCode { get; } = ["+262"]; + + // + public IEnumerable States => + [ + new("Réunion", "RE-RE", "Region") + ]; +} + diff --git a/src/World.Net/Countries/Romania.cs b/src/World.Net/Countries/Romania.cs new file mode 100644 index 0000000..97778f2 --- /dev/null +++ b/src/World.Net/Countries/Romania.cs @@ -0,0 +1,79 @@ +namespace World.Net.Countries; + +internal sealed class Romania : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Romania; + + // + public string Name { get; } = "Romania"; + + // + public string OfficialName { get; } = "Romania"; + + // + public string NativeName => "România"; + + // + public string Capital { get; } = "Bucharest"; + + // + public int NumericCode { get; } = 642; + + // + public string ISO2Code { get; } = "RO"; + + // + public string ISO3Code { get; } = "ROU"; + + // + public string[] CallingCode { get; } = ["+40"]; + + // + public IEnumerable States => + [ + new("Alba", "RO-AB", "County"), + new("Arad", "RO-AR", "County"), + new("Argeș", "RO-AG", "County"), + new("Bacău", "RO-BC", "County"), + new("Bihor", "RO-BH", "County"), + new("Bistrița-Năsăud", "RO-BN", "County"), + new("Botoșani", "RO-BT", "County"), + new("Brașov", "RO-BV", "County"), + new("Brăila", "RO-BR", "County"), + new("Buzău", "RO-BZ", "County"), + new("Caraș-Severin", "RO-CS", "County"), + new("Călărași", "RO-CL", "County"), + new("Cluj", "RO-CJ", "County"), + new("Constanța", "RO-CT", "County"), + new("Covasna", "RO-CV", "County"), + new("Dâmbovița", "RO-DB", "County"), + new("Dolj", "RO-DJ", "County"), + new("Galați", "RO-GL", "County"), + new("Giurgiu", "RO-GR", "County"), + new("Gorj", "RO-GJ", "County"), + new("Harghita", "RO-HR", "County"), + new("Hunedoara", "RO-HD", "County"), + new("Ialomița", "RO-IL", "County"), + new("Iași", "RO-IS", "County"), + new("Ilfov", "RO-IF", "County"), + new("Maramureș", "RO-MM", "County"), + new("Mehedinți", "RO-MH", "County"), + new("Mureș", "RO-MS", "County"), + new("Neamț", "RO-NT", "County"), + new("Olt", "RO-OT", "County"), + new("Prahova", "RO-PH", "County"), + new("Satu Mare", "RO-SM", "County"), + new("Sălaj", "RO-SJ", "County"), + new("Sibiu", "RO-SB", "County"), + new("Suceava", "RO-SV", "County"), + new("Teleorman", "RO-TR", "County"), + new("Timiș", "RO-TM", "County"), + new("Tulcea", "RO-TL", "County"), + new("Vaslui", "RO-VS", "County"), + new("Vâlcea", "RO-VL", "County"), + new("Vrancea", "RO-VN", "County"), + new("Bucharest", "RO-B", "Municipality") + ]; +} + diff --git a/src/World.Net/Countries/Russia.cs b/src/World.Net/Countries/Russia.cs new file mode 100644 index 0000000..13e1b06 --- /dev/null +++ b/src/World.Net/Countries/Russia.cs @@ -0,0 +1,120 @@ +namespace World.Net.Countries; + +internal sealed class Russia : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Russia; + + // + public string Name { get; } = "Russia"; + + // + public string OfficialName { get; } = "Russian Federation"; + + // + public string NativeName => "Россия"; + + // + public string Capital { get; } = "Moscow"; + + // + public int NumericCode { get; } = 643; + + // + public string ISO2Code { get; } = "RU"; + + // + public string ISO3Code { get; } = "RUS"; + + // + public string[] CallingCode { get; } = ["+7"]; + + // + public IEnumerable States => + [ + new("Adygea", "RU-AD", "Federal Subject"), + new("Altai Republic", "RU-AL", "Federal Subject"), + new("Altai Krai", "RU-ALT", "Federal Subject"), + new("Amur Oblast", "RU-AMU", "Federal Subject"), + new("Arkhangelsk Oblast", "RU-ARK", "Federal Subject"), + new("Astrakhan Oblast", "RU-AST", "Federal Subject"), + new("Bashkortostan", "RU-BA", "Federal Subject"), + new("Belgorod Oblast", "RU-BEL", "Federal Subject"), + new("Bryansk Oblast", "RU-BRY", "Federal Subject"), + new("Buryatia", "RU-BU", "Federal Subject"), + new("Chechnya", "RU-CE", "Federal Subject"), + new("Chelyabinsk Oblast", "RU-CHE", "Federal Subject"), + new("Chukotka", "RU-CHU", "Federal Subject"), + new("Chuvashia", "RU-CU", "Federal Subject"), + new("Dagestan", "RU-DA", "Federal Subject"), + new("Ingushetia", "RU-IN", "Federal Subject"), + new("Irkutsk Oblast", "RU-IRK", "Federal Subject"), + new("Ivanovo Oblast", "RU-IVA", "Federal Subject"), + new("Jewish Autonomous Oblast", "RU-YEV", "Federal Subject"), + new("Kabardino-Balkaria", "RU-KB", "Federal Subject"), + new("Kaliningrad Oblast", "RU-KGD", "Federal Subject"), + new("Kalmykia", "RU-KL", "Federal Subject"), + new("Kaluga Oblast", "RU-KLU", "Federal Subject"), + new("Kamchatka Krai", "RU-KAM", "Federal Subject"), + new("Karachay-Cherkessia", "RU-KC", "Federal Subject"), + new("Karelia", "RU-KR", "Federal Subject"), + new("Kemerovo Oblast", "RU-KEM", "Federal Subject"), + new("Khabarovsk Krai", "RU-KHA", "Federal Subject"), + new("Khakassia", "RU-KK", "Federal Subject"), + new("Khanty-Mansi Autonomous Okrug", "RU-KHM", "Federal Subject"), + new("Kirov Oblast", "RU-KIR", "Federal Subject"), + new("Komi", "RU-KO", "Federal Subject"), + new("Kostroma Oblast", "RU-KOS", "Federal Subject"), + new("Krasnodar Krai", "RU-KDA", "Federal Subject"), + new("Krasnoyarsk Krai", "RU-KYA", "Federal Subject"), + new("Kurgan Oblast", "RU-KUR", "Federal Subject"), + new("Kursk Oblast", "RU-KRS", "Federal Subject"), + new("Leningrad Oblast", "RU-LEN", "Federal Subject"), + new("Lipetsk Oblast", "RU-LIP", "Federal Subject"), + new("Magadan Oblast", "RU-MAG", "Federal Subject"), + new("Mari El", "RU-ME", "Federal Subject"), + new("Mordovia", "RU-MO", "Federal Subject"), + new("Moscow", "RU-MOS", "Federal Subject"), + new("Moscow Oblast", "RU-MOW", "Federal Subject"), + new("Murmansk Oblast", "RU-MUR", "Federal Subject"), + new("Nenets Autonomous Okrug", "RU-NEN", "Federal Subject"), + new("Nizhny Novgorod Oblast", "RU-NIZ", "Federal Subject"), + new("North Ossetia–Alania", "RU-SE", "Federal Subject"), + new("Novgorod Oblast", "RU-NGR", "Federal Subject"), + new("Novosibirsk Oblast", "RU-NVS", "Federal Subject"), + new("Omsk Oblast", "RU-OMS", "Federal Subject"), + new("Orenburg Oblast", "RU-ORE", "Federal Subject"), + new("Oryol Oblast", "RU-ORL", "Federal Subject"), + new("Penza Oblast", "RU-PNZ", "Federal Subject"), + new("Perm Krai", "RU-PER", "Federal Subject"), + new("Primorsky Krai", "RU-PRI", "Federal Subject"), + new("Pskov Oblast", "RU-PSK", "Federal Subject"), + new("Rostov Oblast", "RU-ROS", "Federal Subject"), + new("Ryazan Oblast", "RU-RYA", "Federal Subject"), + new("Saint Petersburg", "RU-SPE", "Federal Subject"), + new("Sakha Republic (Yakutia)", "RU-SAK", "Federal Subject"), + new("Sakhalin Oblast", "RU-SAKH", "Federal Subject"), + new("Samara Oblast", "RU-SAM", "Federal Subject"), + new("Saratov Oblast", "RU-SAR", "Federal Subject"), + new("Smolensk Oblast", "RU-SMO", "Federal Subject"), + new("Stavropol Krai", "RU-STA", "Federal Subject"), + new("Sverdlovsk Oblast", "RU-SVE", "Federal Subject"), + new("Tambov Oblast", "RU-TAM", "Federal Subject"), + new("Tatarstan", "RU-TA", "Federal Subject"), + new("Tomsk Oblast", "RU-TOM", "Federal Subject"), + new("Tula Oblast", "RU-TUL", "Federal Subject"), + new("Tuva", "RU-TY", "Federal Subject"), + new("Tver Oblast", "RU-TVE", "Federal Subject"), + new("Tyumen Oblast", "RU-TYU", "Federal Subject"), + new("Udmurtia", "RU-UD", "Federal Subject"), + new("Ulyanovsk Oblast", "RU-ULY", "Federal Subject"), + new("Vladimir Oblast", "RU-VLA", "Federal Subject"), + new("Volgograd Oblast", "RU-VGG", "Federal Subject"), + new("Vologda Oblast", "RU-VLG", "Federal Subject"), + new("Voronezh Oblast", "RU-VOR", "Federal Subject"), + new("Yamalo-Nenets Autonomous Okrug", "RU-YAN", "Federal Subject"), + new("Yaroslavl Oblast", "RU-YAR", "Federal Subject"), + new("Zabaykalsky Krai", "RU-ZAB", "Federal Subject") + ]; +} + diff --git a/src/World.Net/Countries/Rwanda.cs b/src/World.Net/Countries/Rwanda.cs new file mode 100644 index 0000000..dc90bde --- /dev/null +++ b/src/World.Net/Countries/Rwanda.cs @@ -0,0 +1,42 @@ +namespace World.Net.Countries; + +internal sealed class Rwanda : ICountry +{ + // + public CountryIdentifier Id => CountryIdentifier.Rwanda; + + // + public string Name { get; } = "Rwanda"; + + // + public string OfficialName { get; } = "Republic of Rwanda"; + + // + public string NativeName => "Rwanda"; + + // + public string Capital { get; } = "Kigali"; + + // + public int NumericCode { get; } = 646; + + // + public string ISO2Code { get; } = "RW"; + + // + public string ISO3Code { get; } = "RWA"; + + // + public string[] CallingCode { get; } = ["+250"]; + + // + public IEnumerable States => + [ + new("Kigali", "RW-KI", "Province"), + new("Eastern", "RW-ES", "Province"), + new("Northern", "RW-NO", "Province"), + new("Western", "RW-WE", "Province"), + new("Southern", "RW-SO", "Province") + ]; +} + diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index fa2cfe5..e1b6bf1 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -155,6 +155,11 @@ public static Dictionary Initialize() { CountryIdentifier.Poland, new Poland() }, { CountryIdentifier.Portugal, new Portugal() }, { CountryIdentifier.PuertoRico, new PuertoRico() }, + { CountryIdentifier.Qatar, new Qatar() }, + { CountryIdentifier.Reunion, new Reunion() }, + { CountryIdentifier.Romania, new Romania() }, + { CountryIdentifier.Russia, new Russia() }, + { CountryIdentifier.Rwanda, new Rwanda() }, // Future countries can be added here in the same format. };