From 13b04528e2f483aa8d1591e5dc0591a1fe5351cd Mon Sep 17 00:00:00 2001 From: IDAM Date: Sat, 20 Dec 2025 07:33:00 +0100 Subject: [PATCH] added details for more countries --- .../Countries/MonacoTest.cs | 36 +++++++++++ .../Countries/MongoliaTest.cs | 61 +++++++++++++++++++ .../Countries/MontenegroTest.cs | 60 ++++++++++++++++++ .../Countries/MontserratTest.cs | 36 +++++++++++ .../Countries/MoroccoTest.cs | 50 +++++++++++++++ .../Countries/MozambiqueTest.cs | 49 +++++++++++++++ .../Countries/MyanmarTest.cs | 53 ++++++++++++++++ .../Countries/NamibiaTest.cs | 51 ++++++++++++++++ .../Countries/NauruTest.cs | 52 ++++++++++++++++ .../Countries/NepalTest.cs | 45 ++++++++++++++ .../Countries/NetherlandsTest.cs | 50 +++++++++++++++ .../Countries/NewCaledoniaTest.cs | 41 +++++++++++++ .../Countries/NewZealandTest.cs | 55 +++++++++++++++++ .../Countries/NicaraguaTest.cs | 55 +++++++++++++++++ .../Countries/NigerTest.cs | 46 ++++++++++++++ src/World.Net/Countries/Monaco.cs | 25 ++++++++ src/World.Net/Countries/Mongolia.cs | 49 +++++++++++++++ src/World.Net/Countries/Montenegro.cs | 48 +++++++++++++++ src/World.Net/Countries/Montserrat.cs | 25 ++++++++ src/World.Net/Countries/Morocco.cs | 39 ++++++++++++ src/World.Net/Countries/Mozambique.cs | 38 ++++++++++++ src/World.Net/Countries/Myanmar.cs | 42 +++++++++++++ src/World.Net/Countries/Namibia.cs | 40 ++++++++++++ src/World.Net/Countries/Nauru.cs | 41 +++++++++++++ src/World.Net/Countries/Nepal.cs | 33 ++++++++++ src/World.Net/Countries/Netherlands.cs | 39 ++++++++++++ src/World.Net/Countries/NewCaledonia.cs | 29 +++++++++ src/World.Net/Countries/NewZealand.cs | 44 +++++++++++++ src/World.Net/Countries/Nicaragua.cs | 44 +++++++++++++ src/World.Net/Countries/Niger.cs | 35 +++++++++++ src/World.Net/Helpers/CountryInitializer.cs | 15 +++++ 31 files changed, 1326 insertions(+) create mode 100644 src/World.Net.UnitTests/Countries/MonacoTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MongoliaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MontenegroTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MontserratTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MoroccoTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MozambiqueTest.cs create mode 100644 src/World.Net.UnitTests/Countries/MyanmarTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NamibiaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NauruTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NepalTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NetherlandsTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NewCaledoniaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NewZealandTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NicaraguaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/NigerTest.cs create mode 100644 src/World.Net/Countries/Monaco.cs create mode 100644 src/World.Net/Countries/Mongolia.cs create mode 100644 src/World.Net/Countries/Montenegro.cs create mode 100644 src/World.Net/Countries/Montserrat.cs create mode 100644 src/World.Net/Countries/Morocco.cs create mode 100644 src/World.Net/Countries/Mozambique.cs create mode 100644 src/World.Net/Countries/Myanmar.cs create mode 100644 src/World.Net/Countries/Namibia.cs create mode 100644 src/World.Net/Countries/Nauru.cs create mode 100644 src/World.Net/Countries/Nepal.cs create mode 100644 src/World.Net/Countries/Netherlands.cs create mode 100644 src/World.Net/Countries/NewCaledonia.cs create mode 100644 src/World.Net/Countries/NewZealand.cs create mode 100644 src/World.Net/Countries/Nicaragua.cs create mode 100644 src/World.Net/Countries/Niger.cs diff --git a/src/World.Net.UnitTests/Countries/MonacoTest.cs b/src/World.Net.UnitTests/Countries/MonacoTest.cs new file mode 100644 index 0000000..371f46c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MonacoTest.cs @@ -0,0 +1,36 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class MonacoTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Monaco"; + private const string OFFICIAL_NAME = "Principality of Monaco"; + private const string NATIVE_NAME = "Principauté de Monaco"; + private const string CAPITAL = "Monaco"; + private const string ISO2_CODE = "MC"; + private const string ISO3_CODE = "MCO"; + private const int NUMERIC_CODE = 492; + private readonly string[] CALLING_CODE = ["+377"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Monaco; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = []; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMonaco() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MongoliaTest.cs b/src/World.Net.UnitTests/Countries/MongoliaTest.cs new file mode 100644 index 0000000..6648804 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MongoliaTest.cs @@ -0,0 +1,61 @@ + +namespace World.Net.UnitTests.Countries; + +public sealed class MongoliaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Mongolia"; + private const string OFFICIAL_NAME = "Mongolia"; + private const string NATIVE_NAME = "Монгол Улс"; + private const string CAPITAL = "Ulaanbaatar"; + private const string ISO2_CODE = "MN"; + private const string ISO3_CODE = "MNG"; + private const int NUMERIC_CODE = 496; + private readonly string[] CALLING_CODE = ["+976"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Mongolia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Arkhangai", "MN-073", "Province"), + ("Bayan-Ölgii", "MN-071", "Province"), + ("Bayankhongor", "MN-069", "Province"), + ("Bulgan", "MN-067", "Province"), + ("Darkhan-Uul", "MN-037", "Province"), + ("Dornod", "MN-061", "Province"), + ("Dornogovi", "MN-063", "Province"), + ("Dundgovi", "MN-059", "Province"), + ("Govi-Altai", "MN-065", "Province"), + ("Govisümber", "MN-064", "Province"), + ("Khentii", "MN-039", "Province"), + ("Khovd", "MN-043", "Province"), + ("Khövsgöl", "MN-041", "Province"), + ("Ömnögovi", "MN-053", "Province"), + ("Orkhon", "MN-035", "Province"), + ("Övörkhangai", "MN-055", "Province"), + ("Selenge", "MN-049", "Province"), + ("Sükhbaatar", "MN-051", "Province"), + ("Töv", "MN-047", "Province"), + ("Uvs", "MN-046", "Province"), + ("Zavkhan", "MN-057", "Province"), + ("Ulaanbaatar", "MN-1", "Municipality") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMongolia() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MontenegroTest.cs b/src/World.Net.UnitTests/Countries/MontenegroTest.cs new file mode 100644 index 0000000..38c230b --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MontenegroTest.cs @@ -0,0 +1,60 @@ +using System; +namespace World.Net.UnitTests.Countries; + +public sealed class MontenegroTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Montenegro"; + private const string OFFICIAL_NAME = "Montenegro"; + private const string NATIVE_NAME = "Crna Gora"; + private const string CAPITAL = "Podgorica"; + private const string ISO2_CODE = "ME"; + private const string ISO3_CODE = "MNE"; + private const int NUMERIC_CODE = 499; + private readonly string[] CALLING_CODE = ["+382"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Montenegro; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Andrijevica", "ME-01", "Municipality"), + ("Bar", "ME-02", "Municipality"), + ("Berane", "ME-03", "Municipality"), + ("Bijelo Polje", "ME-04", "Municipality"), + ("Budva", "ME-05", "Municipality"), + ("Cetinje", "ME-06", "Municipality"), + ("Danilovgrad", "ME-07", "Municipality"), + ("Herceg Novi", "ME-08", "Municipality"), + ("Kolašin", "ME-09", "Municipality"), + ("Kotor", "ME-10", "Municipality"), + ("Mojkovac", "ME-11", "Municipality"), + ("Nikšić", "ME-12", "Municipality"), + ("Plav", "ME-13", "Municipality"), + ("Pljevlja", "ME-14", "Municipality"), + ("Plužine", "ME-15", "Municipality"), + ("Podgorica", "ME-16", "Municipality"), + ("Rožaje", "ME-17", "Municipality"), + ("Šavnik", "ME-18", "Municipality"), + ("Tivat", "ME-19", "Municipality"), + ("Ulcinj", "ME-20", "Municipality"), + ("Žabljak", "ME-21", "Municipality") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMontenegro() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MontserratTest.cs b/src/World.Net.UnitTests/Countries/MontserratTest.cs new file mode 100644 index 0000000..5cd55da --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MontserratTest.cs @@ -0,0 +1,36 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class MontserratTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Montserrat"; + private const string OFFICIAL_NAME = "Montserrat"; + private const string NATIVE_NAME = "Montserrat"; + private const string CAPITAL = "Plymouth"; + private const string ISO2_CODE = "MS"; + private const string ISO3_CODE = "MSR"; + private const int NUMERIC_CODE = 500; + private readonly string[] CALLING_CODE = ["+1-664"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Montserrat; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = []; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMontserrat() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MoroccoTest.cs b/src/World.Net.UnitTests/Countries/MoroccoTest.cs new file mode 100644 index 0000000..61700d4 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MoroccoTest.cs @@ -0,0 +1,50 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class MoroccoTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Morocco"; + private const string OFFICIAL_NAME = "Kingdom of Morocco"; + private const string NATIVE_NAME = "المغرب"; + private const string CAPITAL = "Rabat"; + private const string ISO2_CODE = "MA"; + private const string ISO3_CODE = "MAR"; + private const int NUMERIC_CODE = 504; + private readonly string[] CALLING_CODE = ["+212"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Morocco; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Tanger-Tetouan-Al Hoceima", "MA-01", "Region"), + ("Oriental", "MA-02", "Region"), + ("Fes-Meknes", "MA-03", "Region"), + ("Rabat-Sale-Kenitra", "MA-04", "Region"), + ("Beni Mellal-Khenifra", "MA-05", "Region"), + ("Casablanca-Settat", "MA-06", "Region"), + ("Marrakesh-Safi", "MA-07", "Region"), + ("Draa-Tafilalet", "MA-08", "Region"), + ("Souss-Massa", "MA-09", "Region"), + ("Guelmim-Oued Noun", "MA-10", "Region"), + ("Laayoune-Sakia El Hamra", "MA-11", "Region"), + ("Dakhla-Oued Ed-Dahab", "MA-12", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMorocco() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MozambiqueTest.cs b/src/World.Net.UnitTests/Countries/MozambiqueTest.cs new file mode 100644 index 0000000..cb6e744 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MozambiqueTest.cs @@ -0,0 +1,49 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class MozambiqueTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Mozambique"; + private const string OFFICIAL_NAME = "Republic of Mozambique"; + private const string NATIVE_NAME = "Moçambique"; + private const string CAPITAL = "Maputo"; + private const string ISO2_CODE = "MZ"; + private const string ISO3_CODE = "MOZ"; + private const int NUMERIC_CODE = 508; + private readonly string[] CALLING_CODE = ["+258"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Mozambique; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Cabo Delgado", "MZ-P", "Province"), + ("Gaza", "MZ-G", "Province"), + ("Inhambane", "MZ-I", "Province"), + ("Manica", "MZ-B", "Province"), + ("Maputo Province", "MZ-L", "Province"), + ("Maputo City", "MZ-MPM", "City"), + ("Nampula", "MZ-N", "Province"), + ("Niassa", "MZ-A", "Province"), + ("Sofala", "MZ-S", "Province"), + ("Tete", "MZ-T", "Province"), + ("Zambezia", "MZ-Q", "Province") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMozambique() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/MyanmarTest.cs b/src/World.Net.UnitTests/Countries/MyanmarTest.cs new file mode 100644 index 0000000..a3b01f6 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/MyanmarTest.cs @@ -0,0 +1,53 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class MyanmarTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Myanmar"; + private const string OFFICIAL_NAME = "Republic of the Union of Myanmar"; + private const string NATIVE_NAME = "မြန်မာ"; + private const string CAPITAL = "Naypyidaw"; + private const string ISO2_CODE = "MM"; + private const string ISO3_CODE = "MMR"; + private const int NUMERIC_CODE = 104; + private readonly string[] CALLING_CODE = ["+95"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Myanmar; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Ayeyarwady", "MM-07", "Region"), + ("Bago", "MM-02", "Region"), + ("Chin", "MM-14", "State"), + ("Kachin", "MM-11", "State"), + ("Kayah", "MM-12", "State"), + ("Kayin", "MM-13", "State"), + ("Magway", "MM-03", "Region"), + ("Mandalay", "MM-04", "Region"), + ("Mon", "MM-15", "State"), + ("Naypyidaw", "MM-18", "Union Territory"), + ("Rakhine", "MM-16", "State"), + ("Sagaing", "MM-01", "Region"), + ("Shan", "MM-17", "State"), + ("Tanintharyi", "MM-05", "Region"), + ("Yangon", "MM-06", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForMyanmar() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NamibiaTest.cs b/src/World.Net.UnitTests/Countries/NamibiaTest.cs new file mode 100644 index 0000000..f5859a2 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NamibiaTest.cs @@ -0,0 +1,51 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NamibiaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Namibia"; + private const string OFFICIAL_NAME = "Republic of Namibia"; + private const string NATIVE_NAME = "Namibia"; + private const string CAPITAL = "Windhoek"; + private const string ISO2_CODE = "NA"; + private const string ISO3_CODE = "NAM"; + private const int NUMERIC_CODE = 516; + private readonly string[] CALLING_CODE = ["+264"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Namibia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Erongo", "NA-ER", "Region"), + ("Hardap", "NA-HA", "Region"), + ("Kavango East", "NA-KE", "Region"), + ("Kavango West", "NA-KW", "Region"), + ("Khomas", "NA-KH", "Region"), + ("Kunene", "NA-KU", "Region"), + ("Ohangwena", "NA-OW", "Region"), + ("Omaheke", "NA-OH", "Region"), + ("Omusati", "NA-OS", "Region"), + ("Oshana", "NA-ON", "Region"), + ("Oshikoto", "NA-OT", "Region"), + ("Otjozondjupa", "NA-OD", "Region"), + ("Zambezi", "NA-CA", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNamibia() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NauruTest.cs b/src/World.Net.UnitTests/Countries/NauruTest.cs new file mode 100644 index 0000000..59c7c3d --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NauruTest.cs @@ -0,0 +1,52 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NauruTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Nauru"; + private const string OFFICIAL_NAME = "Republic of Nauru"; + private const string NATIVE_NAME = "Nauru"; + private const string CAPITAL = "Yaren"; + private const string ISO2_CODE = "NR"; + private const string ISO3_CODE = "NRU"; + private const int NUMERIC_CODE = 520; + private readonly string[] CALLING_CODE = ["+674"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Nauru; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Aiwo", "NR-01", "District"), + ("Anabar", "NR-02", "District"), + ("Anetan", "NR-03", "District"), + ("Anibare", "NR-04", "District"), + ("Baiti", "NR-05", "District"), + ("Boe", "NR-06", "District"), + ("Buada", "NR-07", "District"), + ("Denigomodu", "NR-08", "District"), + ("Ewa", "NR-09", "District"), + ("Ijuw", "NR-10", "District"), + ("Meneng", "NR-11", "District"), + ("Nibok", "NR-12", "District"), + ("Uaboe", "NR-13", "District"), + ("Yaren", "NR-14", "District") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNauru() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NepalTest.cs b/src/World.Net.UnitTests/Countries/NepalTest.cs new file mode 100644 index 0000000..ef96ef1 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NepalTest.cs @@ -0,0 +1,45 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NepalTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Nepal"; + private const string OFFICIAL_NAME = "Federal Democratic Republic of Nepal"; + private const string NATIVE_NAME = "नेपाल"; + private const string CAPITAL = "Kathmandu"; + private const string ISO2_CODE = "NP"; + private const string ISO3_CODE = "NPL"; + private const int NUMERIC_CODE = 524; + private readonly string[] CALLING_CODE = ["+977"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Nepal; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Koshi", "NP-P1", "Province"), + ("Madhesh", "NP-P2", "Province"), + ("Bagmati", "NP-P3", "Province"), + ("Gandaki", "NP-P4", "Province"), + ("Lumbini", "NP-P5", "Province"), + ("Karnali", "NP-P6", "Province"), + ("Sudurpashchim", "NP-P7", "Province") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNepal() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NetherlandsTest.cs b/src/World.Net.UnitTests/Countries/NetherlandsTest.cs new file mode 100644 index 0000000..2235fab --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NetherlandsTest.cs @@ -0,0 +1,50 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NetherlandsTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Netherlands"; + private const string OFFICIAL_NAME = "Kingdom of the Netherlands"; + private const string NATIVE_NAME = "Nederland"; + private const string CAPITAL = "Amsterdam"; + private const string ISO2_CODE = "NL"; + private const string ISO3_CODE = "NLD"; + private const int NUMERIC_CODE = 528; + private readonly string[] CALLING_CODE = ["+31"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Netherlands; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Drenthe", "NL-DR", "Province"), + ("Flevoland", "NL-FL", "Province"), + ("Friesland", "NL-FR", "Province"), + ("Gelderland", "NL-GE", "Province"), + ("Groningen", "NL-GR", "Province"), + ("Limburg", "NL-LI", "Province"), + ("North Brabant", "NL-NB", "Province"), + ("North Holland", "NL-NH", "Province"), + ("Overijssel", "NL-OV", "Province"), + ("South Holland", "NL-ZH", "Province"), + ("Utrecht", "NL-UT", "Province"), + ("Zeeland", "NL-ZE", "Province") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNetherlands() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NewCaledoniaTest.cs b/src/World.Net.UnitTests/Countries/NewCaledoniaTest.cs new file mode 100644 index 0000000..ae95722 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NewCaledoniaTest.cs @@ -0,0 +1,41 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NewCaledoniaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "New Caledonia"; + private const string OFFICIAL_NAME = "New Caledonia"; + private const string NATIVE_NAME = "Nouvelle-Calédonie"; + private const string CAPITAL = "Nouméa"; + private const string ISO2_CODE = "NC"; + private const string ISO3_CODE = "NCL"; + private const int NUMERIC_CODE = 540; + private readonly string[] CALLING_CODE = ["+687"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NewCaledonia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("North Province", "NC-N", "Province"), + ("South Province", "NC-S", "Province"), + ("Loyalty Islands Province", "NC-L", "Province") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNewCaledonia() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NewZealandTest.cs b/src/World.Net.UnitTests/Countries/NewZealandTest.cs new file mode 100644 index 0000000..6ef0c37 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NewZealandTest.cs @@ -0,0 +1,55 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NewZealandTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "New Zealand"; + private const string OFFICIAL_NAME = "New Zealand"; + private const string NATIVE_NAME = "Aotearoa"; + private const string CAPITAL = "Wellington"; + private const string ISO2_CODE = "NZ"; + private const string ISO3_CODE = "NZL"; + private const int NUMERIC_CODE = 554; + private readonly string[] CALLING_CODE = ["+64"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.NewZealand; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Auckland", "NZ-AUK", "Region"), + ("Bay of Plenty", "NZ-BOP", "Region"), + ("Canterbury", "NZ-CAN", "Region"), + ("Chatham Islands Territory", "NZ-CIT", "Territory"), + ("Gisborne", "NZ-GIS", "Region"), + ("Hawke's Bay", "NZ-HKB", "Region"), + ("Manawatu-Whanganui", "NZ-MWT", "Region"), + ("Marlborough", "NZ-MBH", "Region"), + ("Nelson", "NZ-NSN", "Region"), + ("Northland", "NZ-NTL", "Region"), + ("Otago", "NZ-OTA", "Region"), + ("Southland", "NZ-STL", "Region"), + ("Taranaki", "NZ-TKI", "Region"), + ("Tasman", "NZ-TAS", "Region"), + ("Waikato", "NZ-WKO", "Region"), + ("Wellington", "NZ-WGN", "Region"), + ("West Coast", "NZ-WTC", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNewZealand() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NicaraguaTest.cs b/src/World.Net.UnitTests/Countries/NicaraguaTest.cs new file mode 100644 index 0000000..c4433b2 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NicaraguaTest.cs @@ -0,0 +1,55 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NicaraguaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Nicaragua"; + private const string OFFICIAL_NAME = "Republic of Nicaragua"; + private const string NATIVE_NAME = "Nicaragua"; + private const string CAPITAL = "Managua"; + private const string ISO2_CODE = "NI"; + private const string ISO3_CODE = "NIC"; + private const int NUMERIC_CODE = 558; + private readonly string[] CALLING_CODE = ["+505"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Nicaragua; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Boaco", "NI-BO", "Department"), + ("Carazo", "NI-CA", "Department"), + ("Chinandega", "NI-CI", "Department"), + ("Chontales", "NI-CO", "Department"), + ("Estelí", "NI-ES", "Department"), + ("Granada", "NI-GR", "Department"), + ("Jinotega", "NI-JI", "Department"), + ("León", "NI-LE", "Department"), + ("Madriz", "NI-MD", "Department"), + ("Managua", "NI-MN", "Department"), + ("Masaya", "NI-MS", "Department"), + ("Matagalpa", "NI-MT", "Department"), + ("North Caribbean Coast", "NI-AN", "Autonomous Region"), + ("South Caribbean Coast", "NI-AS", "Autonomous Region"), + ("Nueva Segovia", "NI-NS", "Department"), + ("Rivas", "NI-RI", "Department"), + ("Río San Juan", "NI-SJ", "Department") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNicaragua() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net.UnitTests/Countries/NigerTest.cs b/src/World.Net.UnitTests/Countries/NigerTest.cs new file mode 100644 index 0000000..0b53aa8 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/NigerTest.cs @@ -0,0 +1,46 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class NigerTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Niger"; + private const string OFFICIAL_NAME = "Republic of the Niger"; + private const string NATIVE_NAME = "Niger"; + private const string CAPITAL = "Niamey"; + private const string ISO2_CODE = "NE"; + private const string ISO3_CODE = "NER"; + private const int NUMERIC_CODE = 562; + private readonly string[] CALLING_CODE = ["+227"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Niger; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Agadez", "NE-1", "Region"), + ("Diffa", "NE-2", "Region"), + ("Dosso", "NE-3", "Region"), + ("Maradi", "NE-4", "Region"), + ("Tahoua", "NE-5", "Region"), + ("Tillabéri", "NE-6", "Region"), + ("Zinder", "NE-7", "Region"), + ("Niamey", "NE-8", "Capital District") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForNiger() + { + var country = CountryProvider.GetCountry(EXPECTEDID); + + AssertCorrectInformation( + country, + EXPECTEDID, + COUNTRY_NAME, + OFFICIAL_NAME, + NATIVE_NAME, + CAPITAL, + NUMERIC_CODE, + ISO2_CODE, + ISO3_CODE, + CALLING_CODE, + EXPECTED_STATES + ); + } +} diff --git a/src/World.Net/Countries/Monaco.cs b/src/World.Net/Countries/Monaco.cs new file mode 100644 index 0000000..8f9c6ab --- /dev/null +++ b/src/World.Net/Countries/Monaco.cs @@ -0,0 +1,25 @@ +namespace World.Net.Countries; + +internal sealed class Monaco : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Monaco; + + public string Name { get; } = "Monaco"; + + public string OfficialName { get; } = "Principality of Monaco"; + + public string NativeName => "Principauté de Monaco"; + + public string Capital { get; } = "Monaco"; + + public int NumericCode { get; } = 492; + + public string ISO2Code { get; } = "MC"; + + public string ISO3Code { get; } = "MCO"; + + public string[] CallingCode { get; } = ["+377"]; + + public IEnumerable States => Array.Empty(); +} + diff --git a/src/World.Net/Countries/Mongolia.cs b/src/World.Net/Countries/Mongolia.cs new file mode 100644 index 0000000..41fb274 --- /dev/null +++ b/src/World.Net/Countries/Mongolia.cs @@ -0,0 +1,49 @@ +namespace World.Net.Countries; + +internal sealed class Mongolia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Mongolia; + + public string Name { get; } = "Mongolia"; + + public string OfficialName { get; } = "Mongolia"; + + public string NativeName => "Монгол Улс"; + + public string Capital { get; } = "Ulaanbaatar"; + + public int NumericCode { get; } = 496; + + public string ISO2Code { get; } = "MN"; + + public string ISO3Code { get; } = "MNG"; + + public string[] CallingCode { get; } = ["+976"]; + + public IEnumerable States => new[] + { + new State("Arkhangai", "MN-073", "Province"), + new State("Bayan-Ölgii", "MN-071", "Province"), + new State("Bayankhongor", "MN-069", "Province"), + new State("Bulgan", "MN-067", "Province"), + new State("Darkhan-Uul", "MN-037", "Province"), + new State("Dornod", "MN-061", "Province"), + new State("Dornogovi", "MN-063", "Province"), + new State("Dundgovi", "MN-059", "Province"), + new State("Govi-Altai", "MN-065", "Province"), + new State("Govisümber", "MN-064", "Province"), + new State("Khentii", "MN-039", "Province"), + new State("Khovd", "MN-043", "Province"), + new State("Khövsgöl", "MN-041", "Province"), + new State("Ömnögovi", "MN-053", "Province"), + new State("Orkhon", "MN-035", "Province"), + new State("Övörkhangai", "MN-055", "Province"), + new State("Selenge", "MN-049", "Province"), + new State("Sükhbaatar", "MN-051", "Province"), + new State("Töv", "MN-047", "Province"), + new State("Uvs", "MN-046", "Province"), + new State("Zavkhan", "MN-057", "Province"), + new State("Ulaanbaatar", "MN-1", "Municipality") + }; +} + diff --git a/src/World.Net/Countries/Montenegro.cs b/src/World.Net/Countries/Montenegro.cs new file mode 100644 index 0000000..c6aaf09 --- /dev/null +++ b/src/World.Net/Countries/Montenegro.cs @@ -0,0 +1,48 @@ +namespace World.Net.Countries; + +internal sealed class Montenegro : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Montenegro; + + public string Name { get; } = "Montenegro"; + + public string OfficialName { get; } = "Montenegro"; + + public string NativeName => "Crna Gora"; + + public string Capital { get; } = "Podgorica"; + + public int NumericCode { get; } = 499; + + public string ISO2Code { get; } = "ME"; + + public string ISO3Code { get; } = "MNE"; + + public string[] CallingCode { get; } = ["+382"]; + + public IEnumerable States => new[] + { + new State("Andrijevica", "ME-01", "Municipality"), + new State("Bar", "ME-02", "Municipality"), + new State("Berane", "ME-03", "Municipality"), + new State("Bijelo Polje", "ME-04", "Municipality"), + new State("Budva", "ME-05", "Municipality"), + new State("Cetinje", "ME-06", "Municipality"), + new State("Danilovgrad", "ME-07", "Municipality"), + new State("Herceg Novi", "ME-08", "Municipality"), + new State("Kolašin", "ME-09", "Municipality"), + new State("Kotor", "ME-10", "Municipality"), + new State("Mojkovac", "ME-11", "Municipality"), + new State("Nikšić", "ME-12", "Municipality"), + new State("Plav", "ME-13", "Municipality"), + new State("Pljevlja", "ME-14", "Municipality"), + new State("Plužine", "ME-15", "Municipality"), + new State("Podgorica", "ME-16", "Municipality"), + new State("Rožaje", "ME-17", "Municipality"), + new State("Šavnik", "ME-18", "Municipality"), + new State("Tivat", "ME-19", "Municipality"), + new State("Ulcinj", "ME-20", "Municipality"), + new State("Žabljak", "ME-21", "Municipality") + }; +} + diff --git a/src/World.Net/Countries/Montserrat.cs b/src/World.Net/Countries/Montserrat.cs new file mode 100644 index 0000000..74b34d9 --- /dev/null +++ b/src/World.Net/Countries/Montserrat.cs @@ -0,0 +1,25 @@ +namespace World.Net.Countries; + +internal sealed class Montserrat : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Montserrat; + + public string Name { get; } = "Montserrat"; + + public string OfficialName { get; } = "Montserrat"; + + public string NativeName => "Montserrat"; + + public string Capital { get; } = "Plymouth"; + + public int NumericCode { get; } = 500; + + public string ISO2Code { get; } = "MS"; + + public string ISO3Code { get; } = "MSR"; + + public string[] CallingCode { get; } = ["+1-664"]; + + public IEnumerable States => Array.Empty(); +} + diff --git a/src/World.Net/Countries/Morocco.cs b/src/World.Net/Countries/Morocco.cs new file mode 100644 index 0000000..c8c5a95 --- /dev/null +++ b/src/World.Net/Countries/Morocco.cs @@ -0,0 +1,39 @@ +namespace World.Net.Countries; + +internal sealed class Morocco : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Morocco; + + public string Name { get; } = "Morocco"; + + public string OfficialName { get; } = "Kingdom of Morocco"; + + public string NativeName => "المغرب"; + + public string Capital { get; } = "Rabat"; + + public int NumericCode { get; } = 504; + + public string ISO2Code { get; } = "MA"; + + public string ISO3Code { get; } = "MAR"; + + public string[] CallingCode { get; } = ["+212"]; + + public IEnumerable States => new[] + { + new State("Tanger-Tetouan-Al Hoceima", "MA-01", "Region"), + new State("Oriental", "MA-02", "Region"), + new State("Fes-Meknes", "MA-03", "Region"), + new State("Rabat-Sale-Kenitra", "MA-04", "Region"), + new State("Beni Mellal-Khenifra", "MA-05", "Region"), + new State("Casablanca-Settat", "MA-06", "Region"), + new State("Marrakesh-Safi", "MA-07", "Region"), + new State("Draa-Tafilalet", "MA-08", "Region"), + new State("Souss-Massa", "MA-09", "Region"), + new State("Guelmim-Oued Noun", "MA-10", "Region"), + new State("Laayoune-Sakia El Hamra", "MA-11", "Region"), + new State("Dakhla-Oued Ed-Dahab", "MA-12", "Region") + }; +} + diff --git a/src/World.Net/Countries/Mozambique.cs b/src/World.Net/Countries/Mozambique.cs new file mode 100644 index 0000000..8583d90 --- /dev/null +++ b/src/World.Net/Countries/Mozambique.cs @@ -0,0 +1,38 @@ +namespace World.Net.Countries; + +internal sealed class Mozambique : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Mozambique; + + public string Name { get; } = "Mozambique"; + + public string OfficialName { get; } = "Republic of Mozambique"; + + public string NativeName => "Moçambique"; + + public string Capital { get; } = "Maputo"; + + public int NumericCode { get; } = 508; + + public string ISO2Code { get; } = "MZ"; + + public string ISO3Code { get; } = "MOZ"; + + public string[] CallingCode { get; } = ["+258"]; + + public IEnumerable States => new[] + { + new State("Cabo Delgado", "MZ-P", "Province"), + new State("Gaza", "MZ-G", "Province"), + new State("Inhambane", "MZ-I", "Province"), + new State("Manica", "MZ-B", "Province"), + new State("Maputo Province", "MZ-L", "Province"), + new State("Maputo City", "MZ-MPM", "City"), + new State("Nampula", "MZ-N", "Province"), + new State("Niassa", "MZ-A", "Province"), + new State("Sofala", "MZ-S", "Province"), + new State("Tete", "MZ-T", "Province"), + new State("Zambezia", "MZ-Q", "Province") + }; +} + diff --git a/src/World.Net/Countries/Myanmar.cs b/src/World.Net/Countries/Myanmar.cs new file mode 100644 index 0000000..4502b49 --- /dev/null +++ b/src/World.Net/Countries/Myanmar.cs @@ -0,0 +1,42 @@ +namespace World.Net.Countries; + +internal sealed class Myanmar : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Myanmar; + + public string Name { get; } = "Myanmar"; + + public string OfficialName { get; } = "Republic of the Union of Myanmar"; + + public string NativeName => "မြန်မာ"; + + public string Capital { get; } = "Naypyidaw"; + + public int NumericCode { get; } = 104; + + public string ISO2Code { get; } = "MM"; + + public string ISO3Code { get; } = "MMR"; + + public string[] CallingCode { get; } = ["+95"]; + + public IEnumerable States => new[] + { + new State("Ayeyarwady", "MM-07", "Region"), + new State("Bago", "MM-02", "Region"), + new State("Chin", "MM-14", "State"), + new State("Kachin", "MM-11", "State"), + new State("Kayah", "MM-12", "State"), + new State("Kayin", "MM-13", "State"), + new State("Magway", "MM-03", "Region"), + new State("Mandalay", "MM-04", "Region"), + new State("Mon", "MM-15", "State"), + new State("Naypyidaw", "MM-18", "Union Territory"), + new State("Rakhine", "MM-16", "State"), + new State("Sagaing", "MM-01", "Region"), + new State("Shan", "MM-17", "State"), + new State("Tanintharyi", "MM-05", "Region"), + new State("Yangon", "MM-06", "Region") + }; +} + diff --git a/src/World.Net/Countries/Namibia.cs b/src/World.Net/Countries/Namibia.cs new file mode 100644 index 0000000..64b84db --- /dev/null +++ b/src/World.Net/Countries/Namibia.cs @@ -0,0 +1,40 @@ +namespace World.Net.Countries; + +internal sealed class Namibia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Namibia; + + public string Name { get; } = "Namibia"; + + public string OfficialName { get; } = "Republic of Namibia"; + + public string NativeName => "Namibia"; + + public string Capital { get; } = "Windhoek"; + + public int NumericCode { get; } = 516; + + public string ISO2Code { get; } = "NA"; + + public string ISO3Code { get; } = "NAM"; + + public string[] CallingCode { get; } = ["+264"]; + + public IEnumerable States => new[] + { + new State("Erongo", "NA-ER", "Region"), + new State("Hardap", "NA-HA", "Region"), + new State("Kavango East", "NA-KE", "Region"), + new State("Kavango West", "NA-KW", "Region"), + new State("Khomas", "NA-KH", "Region"), + new State("Kunene", "NA-KU", "Region"), + new State("Ohangwena", "NA-OW", "Region"), + new State("Omaheke", "NA-OH", "Region"), + new State("Omusati", "NA-OS", "Region"), + new State("Oshana", "NA-ON", "Region"), + new State("Oshikoto", "NA-OT", "Region"), + new State("Otjozondjupa", "NA-OD", "Region"), + new State("Zambezi", "NA-CA", "Region") + }; +} + diff --git a/src/World.Net/Countries/Nauru.cs b/src/World.Net/Countries/Nauru.cs new file mode 100644 index 0000000..5628083 --- /dev/null +++ b/src/World.Net/Countries/Nauru.cs @@ -0,0 +1,41 @@ +namespace World.Net.Countries; + +internal sealed class Nauru : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Nauru; + + public string Name { get; } = "Nauru"; + + public string OfficialName { get; } = "Republic of Nauru"; + + public string NativeName => "Nauru"; + + public string Capital { get; } = "Yaren"; + + public int NumericCode { get; } = 520; + + public string ISO2Code { get; } = "NR"; + + public string ISO3Code { get; } = "NRU"; + + public string[] CallingCode { get; } = ["+674"]; + + public IEnumerable States => new[] + { + new State("Aiwo", "NR-01", "District"), + new State("Anabar", "NR-02", "District"), + new State("Anetan", "NR-03", "District"), + new State("Anibare", "NR-04", "District"), + new State("Baiti", "NR-05", "District"), + new State("Boe", "NR-06", "District"), + new State("Buada", "NR-07", "District"), + new State("Denigomodu", "NR-08", "District"), + new State("Ewa", "NR-09", "District"), + new State("Ijuw", "NR-10", "District"), + new State("Meneng", "NR-11", "District"), + new State("Nibok", "NR-12", "District"), + new State("Uaboe", "NR-13", "District"), + new State("Yaren", "NR-14", "District") + }; +} + diff --git a/src/World.Net/Countries/Nepal.cs b/src/World.Net/Countries/Nepal.cs new file mode 100644 index 0000000..6f74352 --- /dev/null +++ b/src/World.Net/Countries/Nepal.cs @@ -0,0 +1,33 @@ +namespace World.Net.Countries; + +internal sealed class Nepal : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Nepal; + + public string Name { get; } = "Nepal"; + + public string OfficialName { get; } = "Federal Democratic Republic of Nepal"; + + public string NativeName => "नेपाल"; + + public string Capital { get; } = "Kathmandu"; + + public int NumericCode { get; } = 524; + + public string ISO2Code { get; } = "NP"; + + public string ISO3Code { get; } = "NPL"; + + public string[] CallingCode { get; } = ["+977"]; + + public IEnumerable States => new[] + { + new State("Koshi", "NP-P1", "Province"), + new State("Madhesh", "NP-P2", "Province"), + new State("Bagmati", "NP-P3", "Province"), + new State("Gandaki", "NP-P4", "Province"), + new State("Lumbini", "NP-P5", "Province"), + new State("Karnali", "NP-P6", "Province"), + new State("Sudurpashchim", "NP-P7", "Province") + }; +} diff --git a/src/World.Net/Countries/Netherlands.cs b/src/World.Net/Countries/Netherlands.cs new file mode 100644 index 0000000..577a47e --- /dev/null +++ b/src/World.Net/Countries/Netherlands.cs @@ -0,0 +1,39 @@ +namespace World.Net.Countries; + +internal sealed class Netherlands : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Netherlands; + + public string Name { get; } = "Netherlands"; + + public string OfficialName { get; } = "Kingdom of the Netherlands"; + + public string NativeName => "Nederland"; + + public string Capital { get; } = "Amsterdam"; + + public int NumericCode { get; } = 528; + + public string ISO2Code { get; } = "NL"; + + public string ISO3Code { get; } = "NLD"; + + public string[] CallingCode { get; } = ["+31"]; + + public IEnumerable States => new[] + { + new State("Drenthe", "NL-DR", "Province"), + new State("Flevoland", "NL-FL", "Province"), + new State("Friesland", "NL-FR", "Province"), + new State("Gelderland", "NL-GE", "Province"), + new State("Groningen", "NL-GR", "Province"), + new State("Limburg", "NL-LI", "Province"), + new State("North Brabant", "NL-NB", "Province"), + new State("North Holland", "NL-NH", "Province"), + new State("Overijssel", "NL-OV", "Province"), + new State("South Holland", "NL-ZH", "Province"), + new State("Utrecht", "NL-UT", "Province"), + new State("Zeeland", "NL-ZE", "Province") + }; +} + diff --git a/src/World.Net/Countries/NewCaledonia.cs b/src/World.Net/Countries/NewCaledonia.cs new file mode 100644 index 0000000..85acbe0 --- /dev/null +++ b/src/World.Net/Countries/NewCaledonia.cs @@ -0,0 +1,29 @@ +namespace World.Net.Countries; + +internal sealed class NewCaledonia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.NewCaledonia; + + public string Name { get; } = "New Caledonia"; + + public string OfficialName { get; } = "New Caledonia"; + + public string NativeName => "Nouvelle-Calédonie"; + + public string Capital { get; } = "Nouméa"; + + public int NumericCode { get; } = 540; + + public string ISO2Code { get; } = "NC"; + + public string ISO3Code { get; } = "NCL"; + + public string[] CallingCode { get; } = ["+687"]; + + public IEnumerable States => new[] + { + new State("North Province", "NC-N", "Province"), + new State("South Province", "NC-S", "Province"), + new State("Loyalty Islands Province", "NC-L", "Province") + }; +} diff --git a/src/World.Net/Countries/NewZealand.cs b/src/World.Net/Countries/NewZealand.cs new file mode 100644 index 0000000..fa83ce9 --- /dev/null +++ b/src/World.Net/Countries/NewZealand.cs @@ -0,0 +1,44 @@ +namespace World.Net.Countries; + +internal sealed class NewZealand : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.NewZealand; + + public string Name { get; } = "New Zealand"; + + public string OfficialName { get; } = "New Zealand"; + + public string NativeName => "Aotearoa"; + + public string Capital { get; } = "Wellington"; + + public int NumericCode { get; } = 554; + + public string ISO2Code { get; } = "NZ"; + + public string ISO3Code { get; } = "NZL"; + + public string[] CallingCode { get; } = ["+64"]; + + public IEnumerable States => new[] + { + new State("Auckland", "NZ-AUK", "Region"), + new State("Bay of Plenty", "NZ-BOP", "Region"), + new State("Canterbury", "NZ-CAN", "Region"), + new State("Chatham Islands Territory", "NZ-CIT", "Territory"), + new State("Gisborne", "NZ-GIS", "Region"), + new State("Hawke's Bay", "NZ-HKB", "Region"), + new State("Manawatu-Whanganui", "NZ-MWT", "Region"), + new State("Marlborough", "NZ-MBH", "Region"), + new State("Nelson", "NZ-NSN", "Region"), + new State("Northland", "NZ-NTL", "Region"), + new State("Otago", "NZ-OTA", "Region"), + new State("Southland", "NZ-STL", "Region"), + new State("Taranaki", "NZ-TKI", "Region"), + new State("Tasman", "NZ-TAS", "Region"), + new State("Waikato", "NZ-WKO", "Region"), + new State("Wellington", "NZ-WGN", "Region"), + new State("West Coast", "NZ-WTC", "Region") + }; +} + diff --git a/src/World.Net/Countries/Nicaragua.cs b/src/World.Net/Countries/Nicaragua.cs new file mode 100644 index 0000000..193f09f --- /dev/null +++ b/src/World.Net/Countries/Nicaragua.cs @@ -0,0 +1,44 @@ +namespace World.Net.Countries; + +internal sealed class Nicaragua : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Nicaragua; + + public string Name { get; } = "Nicaragua"; + + public string OfficialName { get; } = "Republic of Nicaragua"; + + public string NativeName => "Nicaragua"; + + public string Capital { get; } = "Managua"; + + public int NumericCode { get; } = 558; + + public string ISO2Code { get; } = "NI"; + + public string ISO3Code { get; } = "NIC"; + + public string[] CallingCode { get; } = ["+505"]; + + public IEnumerable States => new[] + { + new State("Boaco", "NI-BO", "Department"), + new State("Carazo", "NI-CA", "Department"), + new State("Chinandega", "NI-CI", "Department"), + new State("Chontales", "NI-CO", "Department"), + new State("Estelí", "NI-ES", "Department"), + new State("Granada", "NI-GR", "Department"), + new State("Jinotega", "NI-JI", "Department"), + new State("León", "NI-LE", "Department"), + new State("Madriz", "NI-MD", "Department"), + new State("Managua", "NI-MN", "Department"), + new State("Masaya", "NI-MS", "Department"), + new State("Matagalpa", "NI-MT", "Department"), + new State("North Caribbean Coast", "NI-AN", "Autonomous Region"), + new State("South Caribbean Coast", "NI-AS", "Autonomous Region"), + new State("Nueva Segovia", "NI-NS", "Department"), + new State("Rivas", "NI-RI", "Department"), + new State("Río San Juan", "NI-SJ", "Department") + }; +} + diff --git a/src/World.Net/Countries/Niger.cs b/src/World.Net/Countries/Niger.cs new file mode 100644 index 0000000..2b5c5c2 --- /dev/null +++ b/src/World.Net/Countries/Niger.cs @@ -0,0 +1,35 @@ +namespace World.Net.Countries; + +internal sealed class Niger : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Niger; + + public string Name { get; } = "Niger"; + + public string OfficialName { get; } = "Republic of the Niger"; + + public string NativeName => "Niger"; + + public string Capital { get; } = "Niamey"; + + public int NumericCode { get; } = 562; + + public string ISO2Code { get; } = "NE"; + + public string ISO3Code { get; } = "NER"; + + public string[] CallingCode { get; } = ["+227"]; + + public IEnumerable States => new[] + { + new State("Agadez", "NE-1", "Region"), + new State("Diffa", "NE-2", "Region"), + new State("Dosso", "NE-3", "Region"), + new State("Maradi", "NE-4", "Region"), + new State("Tahoua", "NE-5", "Region"), + new State("Tillabéri", "NE-6", "Region"), + new State("Zinder", "NE-7", "Region"), + new State("Niamey", "NE-8", "Capital District") + }; +} + diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 99434f3..a5d11fe 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -135,6 +135,21 @@ public static Dictionary Initialize() { CountryIdentifier.Luxembourg, new Luxembourg() }, { CountryIdentifier.MacauSAR, new MacauSAR() }, { CountryIdentifier.Madagascar, new Madagascar() }, + { CountryIdentifier.Monaco, new Monaco() }, + { CountryIdentifier.Mongolia, new Mongolia() }, + { CountryIdentifier.Montenegro, new Montenegro() }, + { CountryIdentifier.Montserrat, new Montserrat() }, + { CountryIdentifier.Morocco, new Morocco() }, + { CountryIdentifier.Mozambique, new Mozambique() }, + { CountryIdentifier.Myanmar, new Myanmar() }, + { CountryIdentifier.Namibia, new Namibia() }, + { CountryIdentifier.Nauru, new Nauru() }, + { CountryIdentifier.Nepal, new Nepal() }, + { CountryIdentifier.Netherlands, new Netherlands() }, + { CountryIdentifier.NewCaledonia, new NewCaledonia() }, + { CountryIdentifier.NewZealand, new NewZealand() }, + { CountryIdentifier.Nicaragua, new Nicaragua() }, + { CountryIdentifier.Niger, new Niger() }, { CountryIdentifier.Nigeria, new Nigeria() }, { CountryIdentifier.Niue, new Niue() }, { CountryIdentifier.NorfolkIsland, new NorfolkIsland() },