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. };