From a582a815b0f621cf14d6219677d3eb1d0b233c05 Mon Sep 17 00:00:00 2001 From: IDAM Date: Fri, 19 Dec 2025 10:18:10 +0100 Subject: [PATCH 1/3] added details for more countries --- .../Countries/TaiwanTest.cs | 68 ++++++++++ .../Countries/TajikistanTest.cs | 43 ++++++ .../Countries/TanzaniaTest.cs | 75 +++++++++++ .../Countries/ThailandTest.cs | 122 +++++++++++++++++ .../Countries/TheGambiaTest.cs | 44 ++++++ src/World.Net.UnitTests/Countries/TogoTest.cs | 43 ++++++ .../Countries/TokelauTest.cs | 41 ++++++ .../Countries/TongaTest.cs | 43 ++++++ .../Countries/TrinidadAndTobagoTest.cs | 52 +++++++ .../Countries/TunisiaTest.cs | 62 +++++++++ .../Countries/TurkeyTest.cs | 127 ++++++++++++++++++ .../Countries/TurkmenistanTest.cs | 52 +++++++ .../Countries/TurksAndCaicosIslandsTest.cs | 36 +++++ .../Countries/TuvaluTest.cs | 55 ++++++++ src/World.Net/Countries/Taiwan.cs | 49 +++++++ src/World.Net/Countries/Tajikistan.cs | 32 +++++ src/World.Net/Countries/Tanzania.cs | 58 ++++++++ src/World.Net/Countries/Thailand.cs | 103 ++++++++++++++ src/World.Net/Countries/TheGambia.cs | 33 +++++ src/World.Net/Countries/Togo.cs | 32 +++++ src/World.Net/Countries/Tokelau.cs | 30 +++++ src/World.Net/Countries/Tonga.cs | 32 +++++ src/World.Net/Countries/TrinidadAndTobago.cs | 40 ++++++ src/World.Net/Countries/Tunisia.cs | 50 +++++++ src/World.Net/Countries/Turkey.cs | 108 +++++++++++++++ src/World.Net/Countries/Turkmenistan.cs | 33 +++++ .../Countries/TurksAndCaicosIslands.cs | 24 ++++ src/World.Net/Countries/Tuvalu.cs | 35 +++++ src/World.Net/Helpers/CountryInitializer.cs | 15 ++- 29 files changed, 1536 insertions(+), 1 deletion(-) create mode 100644 src/World.Net.UnitTests/Countries/TaiwanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TajikistanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TanzaniaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/ThailandTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TheGambiaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TogoTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TokelauTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TongaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TrinidadAndTobagoTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TunisiaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TurkeyTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TurkmenistanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TurksAndCaicosIslandsTest.cs create mode 100644 src/World.Net.UnitTests/Countries/TuvaluTest.cs create mode 100644 src/World.Net/Countries/Taiwan.cs create mode 100644 src/World.Net/Countries/Tajikistan.cs create mode 100644 src/World.Net/Countries/Tanzania.cs create mode 100644 src/World.Net/Countries/Thailand.cs create mode 100644 src/World.Net/Countries/TheGambia.cs create mode 100644 src/World.Net/Countries/Togo.cs create mode 100644 src/World.Net/Countries/Tokelau.cs create mode 100644 src/World.Net/Countries/Tonga.cs create mode 100644 src/World.Net/Countries/TrinidadAndTobago.cs create mode 100644 src/World.Net/Countries/Tunisia.cs create mode 100644 src/World.Net/Countries/Turkey.cs create mode 100644 src/World.Net/Countries/Turkmenistan.cs create mode 100644 src/World.Net/Countries/TurksAndCaicosIslands.cs create mode 100644 src/World.Net/Countries/Tuvalu.cs diff --git a/src/World.Net.UnitTests/Countries/TaiwanTest.cs b/src/World.Net.UnitTests/Countries/TaiwanTest.cs new file mode 100644 index 0000000..9a224ce --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TaiwanTest.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class TaiwanTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Taiwan"; + private const string NATIVE_NAME = "臺灣"; + private const string CAPITAL = "Taipei"; + private const string OFFICIAL_NAME = "Republic of China (Taiwan)"; + private const string ISO2_CODE = "TW"; + private const string ISO3_CODE = "TWN"; + private const int NUMERIC_CODE = 158; + private readonly string[] CALLING_CODE = ["+886"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Taiwan; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Taipei", "TW-TPE", "Municipality"), + ("New Taipei", "TW-NWT", "Municipality"), + ("Taoyuan", "TW-TAO", "Municipality"), + ("Taichung", "TW-TXG", "Municipality"), + ("Tainan", "TW-TNN", "Municipality"), + ("Kaohsiung", "TW-KHH", "Municipality"), + ("Keelung", "TW-KEE", "City"), + ("Hsinchu", "TW-HSZ", "City"), + ("Chiayi", "TW-CYI", "City"), + ("Changhua", "TW-CWH", "County"), + ("Chiayi County", "TW-CYQ", "County"), + ("Hsinchu County", "TW-HSQ", "County"), + ("Hualien", "TW-HWA", "County"), + ("Kaohsiung County", "TW-KAQ", "County"), + ("Miaoli", "TW-MIA", "County"), + ("Nantou", "TW-NAN", "County"), + ("Penghu", "TW-PEN", "County"), + ("Pingtung", "TW-PIF", "County"), + ("Yilan", "TW-YIL", "County"), + ("Yunlin", "TW-YUN", "County"), + ("Taitung", "TW-TTT", "County"), + ("Lienchiang", "TW-LIE", "County") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTaiwan() + { + 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/TajikistanTest.cs b/src/World.Net.UnitTests/Countries/TajikistanTest.cs new file mode 100644 index 0000000..8730dc4 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TajikistanTest.cs @@ -0,0 +1,43 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TajikistanTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Tajikistan"; + private const string NATIVE_NAME = "Ҷумҳурии Тоҷикистон"; + private const string CAPITAL = "Dushanbe"; + private const string OFFICIAL_NAME = "Republic of Tajikistan"; + private const string ISO2_CODE = "TJ"; + private const string ISO3_CODE = "TJK"; + private const int NUMERIC_CODE = 762; + private readonly string[] CALLING_CODE = ["+992"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tajikistan; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Sughd", "TJ-SU", "Region"), + ("Khatlon", "TJ-KT", "Region"), + ("Gorno-Badakhshan", "TJ-GBAO", "Autonomous Region"), + ("Districts of Republican Subordination", "TJ-DRS", "Region"), + ("Dushanbe", "TJ-DU", "Capital District") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTajikistan() + { + 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/TanzaniaTest.cs b/src/World.Net.UnitTests/Countries/TanzaniaTest.cs new file mode 100644 index 0000000..683fd41 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TanzaniaTest.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries; + +public sealed class TanzaniaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Tanzania"; + private const string NATIVE_NAME = "Jamhuri ya Muungano wa Tanzania"; + private const string CAPITAL = "Dodoma"; + private const string OFFICIAL_NAME = "United Republic of Tanzania"; + private const string ISO2_CODE = "TZ"; + private const string ISO3_CODE = "TZA"; + private const int NUMERIC_CODE = 834; + private readonly string[] CALLING_CODE = ["+255"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tanzania; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Arusha", "TZ-AR", "Region"), + ("Dar es Salaam", "TZ-DA", "Region"), + ("Dodoma", "TZ-DO", "Region"), + ("Geita", "TZ-GE", "Region"), + ("Iringa", "TZ-IR", "Region"), + ("Kagera", "TZ-KA", "Region"), + ("Katavi", "TZ-KT", "Region"), + ("Kigoma", "TZ-KI", "Region"), + ("Kilimanjaro", "TZ-KL", "Region"), + ("Lindi", "TZ-LI", "Region"), + ("Manyara", "TZ-MA", "Region"), + ("Mara", "TZ-MR", "Region"), + ("Mbeya", "TZ-MB", "Region"), + ("Morogoro", "TZ-MO", "Region"), + ("Mtwara", "TZ-MT", "Region"), + ("Mwanza", "TZ-MW", "Region"), + ("Njombe", "TZ-NJ", "Region"), + ("Pwani", "TZ-PW", "Region"), + ("Rukwa", "TZ-RU", "Region"), + ("Ruvuma", "TZ-RV", "Region"), + ("Shinyanga", "TZ-SH", "Region"), + ("Simiyu", "TZ-SI", "Region"), + ("Singida", "TZ-SN", "Region"), + ("Tabora", "TZ-TA", "Region"), + ("Tanga", "TZ-TE", "Region"), + ("Songwe", "TZ-SO", "Region"), + ("Zanzibar North", "TZ-ZN", "Region"), + ("Zanzibar South", "TZ-ZS", "Region"), + ("Zanzibar Central/South", "TZ-ZC", "Region"), + ("Zanzibar West", "TZ-ZW", "Region"), + ("Zanzibar Urban/West", "TZ-ZU", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTanzania() + { + 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/ThailandTest.cs b/src/World.Net.UnitTests/Countries/ThailandTest.cs new file mode 100644 index 0000000..cdd06bd --- /dev/null +++ b/src/World.Net.UnitTests/Countries/ThailandTest.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class ThailandTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Thailand"; + private const string NATIVE_NAME = "ประเทศไทย"; + private const string CAPITAL = "Bangkok"; + private const string OFFICIAL_NAME = "Kingdom of Thailand"; + private const string ISO2_CODE = "TH"; + private const string ISO3_CODE = "THA"; + private const int NUMERIC_CODE = 764; + private readonly string[] CALLING_CODE = ["+66"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Thailand; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Amnat Charoen", "TH-37", "Province"), + ("Ang Thong", "TH-15", "Province"), + ("Bangkok", "TH-10", "Province"), + ("Bueng Kan", "TH-38", "Province"), + ("Buri Ram", "TH-31", "Province"), + ("Chachoengsao", "TH-24", "Province"), + ("Chai Nat", "TH-18", "Province"), + ("Chaiyaphum", "TH-36", "Province"), + ("Chanthaburi", "TH-22", "Province"), + ("Chiang Mai", "TH-50", "Province"), + ("Chiang Rai", "TH-57", "Province"), + ("Chonburi", "TH-20", "Province"), + ("Chumphon", "TH-86", "Province"), + ("Kalasin", "TH-46", "Province"), + ("Kamphaeng Phet", "TH-62", "Province"), + ("Kanchanaburi", "TH-71", "Province"), + ("Khon Kaen", "TH-40", "Province"), + ("Krabi", "TH-81", "Province"), + ("Lampang", "TH-52", "Province"), + ("Lamphun", "TH-51", "Province"), + ("Loei", "TH-42", "Province"), + ("Lopburi", "TH-16", "Province"), + ("Mae Hong Son", "TH-58", "Province"), + ("Maha Sarakham", "TH-44", "Province"), + ("Mukdahan", "TH-49", "Province"), + ("Nakhon Nayok", "TH-26", "Province"), + ("Nakhon Pathom", "TH-73", "Province"), + ("Nakhon Phanom", "TH-48", "Province"), + ("Nakhon Ratchasima", "TH-30", "Province"), + ("Nakhon Sawan", "TH-60", "Province"), + ("Nakhon Si Thammarat", "TH-80", "Province"), + ("Nan", "TH-55", "Province"), + ("Narathiwat", "TH-96", "Province"), + ("Nong Bua Lamphu", "TH-39", "Province"), + ("Nong Khai", "TH-43", "Province"), + ("Nonthaburi", "TH-12", "Province"), + ("Pathum Thani", "TH-13", "Province"), + ("Pattani", "TH-94", "Province"), + ("Phang Nga", "TH-82", "Province"), + ("Phatthalung", "TH-93", "Province"), + ("Phayao", "TH-56", "Province"), + ("Phetchabun", "TH-67", "Province"), + ("Phetchaburi", "TH-76", "Province"), + ("Phichit", "TH-66", "Province"), + ("Phitsanulok", "TH-65", "Province"), + ("Phra Nakhon Si Ayutthaya", "TH-14", "Province"), + ("Phrae", "TH-54", "Province"), + ("Phuket", "TH-83", "Province"), + ("Prachinburi", "TH-25", "Province"), + ("Prachuap Khiri Khan", "TH-77", "Province"), + ("Ranong", "TH-85", "Province"), + ("Ratchaburi", "TH-70", "Province"), + ("Rayong", "TH-21", "Province"), + ("Roi Et", "TH-45", "Province"), + ("Sa Kaeo", "TH-27", "Province"), + ("Sakon Nakhon", "TH-47", "Province"), + ("Samut Prakan", "TH-11", "Province"), + ("Samut Sakhon", "TH-74", "Province"), + ("Samut Songkhram", "TH-75", "Province"), + ("Saraburi", "TH-19", "Province"), + ("Satun", "TH-91", "Province"), + ("Sing Buri", "TH-17", "Province"), + ("Si Sa Ket", "TH-33", "Province"), + ("Songkhla", "TH-90", "Province"), + ("Sukhothai", "TH-64", "Province"), + ("Suphan Buri", "TH-72", "Province"), + ("Surat Thani", "TH-84", "Province"), + ("Tak", "TH-63", "Province"), + ("Trang", "TH-92", "Province"), + ("Trat", "TH-23", "Province"), + ("Ubon Ratchathani", "TH-34", "Province"), + ("Udon Thani", "TH-41", "Province"), + ("Uthai Thani", "TH-61", "Province"), + ("Uttaradit", "TH-53", "Province"), + ("Yala", "TH-95", "Province"), + ("Yasothon", "TH-35", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForThailand() + { + 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/TheGambiaTest.cs b/src/World.Net.UnitTests/Countries/TheGambiaTest.cs new file mode 100644 index 0000000..f3c8374 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TheGambiaTest.cs @@ -0,0 +1,44 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TheGambiaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "The Gambia"; + private const string NATIVE_NAME = "The Gambia"; + private const string CAPITAL = "Banjul"; + private const string OFFICIAL_NAME = "Republic of The Gambia"; + private const string ISO2_CODE = "GM"; + private const string ISO3_CODE = "GMB"; + private const int NUMERIC_CODE = 270; + private readonly string[] CALLING_CODE = ["+220"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Gambia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Banjul", "GM-B", "City"), + ("Central River", "GM-CR", "Region"), + ("Lower River", "GM-LR", "Region"), + ("North Bank", "GM-NB", "Region"), + ("Upper River", "GM-UR", "Region"), + ("Western", "GM-W", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTheGambia() + { + 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/TogoTest.cs b/src/World.Net.UnitTests/Countries/TogoTest.cs new file mode 100644 index 0000000..c2bb66b --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TogoTest.cs @@ -0,0 +1,43 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TogoTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Togo"; + private const string NATIVE_NAME = "Togo"; + private const string CAPITAL = "Lomé"; + private const string OFFICIAL_NAME = "Togolese Republic"; + private const string ISO2_CODE = "TG"; + private const string ISO3_CODE = "TGO"; + private const int NUMERIC_CODE = 768; + private readonly string[] CALLING_CODE = ["+228"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Togo; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Centrale", "TG-C", "Region"), + ("Kara", "TG-K", "Region"), + ("Maritime", "TG-M", "Region"), + ("Plateaux", "TG-P", "Region"), + ("Savanes", "TG-S", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTogo() + { + 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/TokelauTest.cs b/src/World.Net.UnitTests/Countries/TokelauTest.cs new file mode 100644 index 0000000..dbb584c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TokelauTest.cs @@ -0,0 +1,41 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TokelauTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Tokelau"; + private const string NATIVE_NAME = "Tokelau"; + private const string CAPITAL = "Nukunonu"; + private const string OFFICIAL_NAME = "Tokelau"; + private const string ISO2_CODE = "TK"; + private const string ISO3_CODE = "TKL"; + private const int NUMERIC_CODE = 772; + private readonly string[] CALLING_CODE = ["+690"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tokelau; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Atafu", "TK-A", "Atoll"), + ("Nukunonu", "TK-N", "Atoll"), + ("Fakaofo", "TK-F", "Atoll") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTokelau() + { + 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/TongaTest.cs b/src/World.Net.UnitTests/Countries/TongaTest.cs new file mode 100644 index 0000000..048a2de --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TongaTest.cs @@ -0,0 +1,43 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TongaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Tonga"; + private const string NATIVE_NAME = "Tonga"; + private const string CAPITAL = "Nukuʻalofa"; + private const string OFFICIAL_NAME = "Kingdom of Tonga"; + private const string ISO2_CODE = "TO"; + private const string ISO3_CODE = "TON"; + private const int NUMERIC_CODE = 776; + private readonly string[] CALLING_CODE = ["+676"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tonga; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Haʻapai", "TO-02", "Division"), + ("Tongatapu", "TO-01", "Division"), + ("Vavaʻu", "TO-05", "Division"), + ("Eua", "TO-03", "Division"), + ("Niuas", "TO-04", "Division") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTonga() + { + 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/TrinidadAndTobagoTest.cs b/src/World.Net.UnitTests/Countries/TrinidadAndTobagoTest.cs new file mode 100644 index 0000000..f3eb045 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TrinidadAndTobagoTest.cs @@ -0,0 +1,52 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TrinidadAndTobagoTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Trinidad and Tobago"; + private const string NATIVE_NAME = "Trinidad and Tobago"; + private const string CAPITAL = "Port of Spain"; + private const string OFFICIAL_NAME = "Republic of Trinidad and Tobago"; + private const string ISO2_CODE = "TT"; + private const string ISO3_CODE = "TTO"; + private const int NUMERIC_CODE = 780; + private readonly string[] CALLING_CODE = ["+1-868"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.TrinidadAndTobago; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Arima", "TT-ARI", "City"), + ("Chaguanas", "TT-CHA", "City"), + ("Couva-Tabaquite-Talparo", "TT-CTT", "Region"), + ("Diego Martin", "TT-DMN", "Region"), + ("Mayaro-Rio Claro", "TT-MRC", "Region"), + ("Penal-Debe", "TT-PDE", "Region"), + ("Point Fortin", "TT-PFT", "Region"), + ("Port of Spain", "TT-POS", "City"), + ("San Fernando", "TT-SFO", "City"), + ("San Juan-Laventille", "TT-SJL", "Region"), + ("Sangre Grande", "TT-SGE", "Region"), + ("Siparia", "TT-SIP", "Region"), + ("Tunapuna-Piarco", "TT-TUP", "Region"), + ("Tobago", "TT-TOB", "Region") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTrinidadAndTobago() + { + 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/TunisiaTest.cs b/src/World.Net.UnitTests/Countries/TunisiaTest.cs new file mode 100644 index 0000000..617d88d --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TunisiaTest.cs @@ -0,0 +1,62 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TunisiaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Tunisia"; + private const string NATIVE_NAME = "تونس"; + private const string CAPITAL = "Tunis"; + private const string OFFICIAL_NAME = "Republic of Tunisia"; + private const string ISO2_CODE = "TN"; + private const string ISO3_CODE = "TUN"; + private const int NUMERIC_CODE = 788; + private readonly string[] CALLING_CODE = ["+216"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tunisia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Ariana", "TN-12", "Governorate"), + ("Beja", "TN-31", "Governorate"), + ("Ben Arous", "TN-13", "Governorate"), + ("Bizerte", "TN-23", "Governorate"), + ("Gabes", "TN-81", "Governorate"), + ("Gafsa", "TN-71", "Governorate"), + ("Jendouba", "TN-32", "Governorate"), + ("Kairouan", "TN-41", "Governorate"), + ("Kasserine", "TN-42", "Governorate"), + ("Kebili", "TN-73", "Governorate"), + ("Kef", "TN-33", "Governorate"), + ("Mahdia", "TN-53", "Governorate"), + ("Manouba", "TN-14", "Governorate"), + ("Medenine", "TN-82", "Governorate"), + ("Monastir", "TN-52", "Governorate"), + ("Nabeul", "TN-21", "Governorate"), + ("Sfax", "TN-81", "Governorate"), + ("Sidi Bouzid", "TN-43", "Governorate"), + ("Siliana", "TN-34", "Governorate"), + ("Sousse", "TN-51", "Governorate"), + ("Tataouine", "TN-83", "Governorate"), + ("Tozeur", "TN-72", "Governorate"), + ("Tunis", "TN-11", "Governorate"), + ("Zaghouan", "TN-22", "Governorate") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTunisia() + { + 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/TurkeyTest.cs b/src/World.Net.UnitTests/Countries/TurkeyTest.cs new file mode 100644 index 0000000..88a7185 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TurkeyTest.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class TurkeyTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Turkey"; + private const string NATIVE_NAME = "Türkiye"; + private const string CAPITAL = "Ankara"; + private const string OFFICIAL_NAME = "Republic of Turkey"; + private const string ISO2_CODE = "TR"; + private const string ISO3_CODE = "TUR"; + private const int NUMERIC_CODE = 792; + private readonly string[] CALLING_CODE = ["+90"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Turkey; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Adana", "TR-01", "Province"), + ("Adıyaman", "TR-02", "Province"), + ("Afyonkarahisar", "TR-03", "Province"), + ("Ağrı", "TR-04", "Province"), + ("Amasya", "TR-05", "Province"), + ("Ankara", "TR-06", "Province"), + ("Antalya", "TR-07", "Province"), + ("Artvin", "TR-08", "Province"), + ("Aydın", "TR-09", "Province"), + ("Balıkesir", "TR-10", "Province"), + ("Bilecik", "TR-11", "Province"), + ("Bingöl", "TR-12", "Province"), + ("Bitlis", "TR-13", "Province"), + ("Bolu", "TR-14", "Province"), + ("Burdur", "TR-15", "Province"), + ("Bursa", "TR-16", "Province"), + ("Çanakkale", "TR-17", "Province"), + ("Çankırı", "TR-18", "Province"), + ("Çorum", "TR-19", "Province"), + ("Denizli", "TR-20", "Province"), + ("Diyarbakır", "TR-21", "Province"), + ("Edirne", "TR-22", "Province"), + ("Elazığ", "TR-23", "Province"), + ("Erzincan", "TR-24", "Province"), + ("Erzurum", "TR-25", "Province"), + ("Eskişehir", "TR-26", "Province"), + ("Gaziantep", "TR-27", "Province"), + ("Giresun", "TR-28", "Province"), + ("Gümüşhane", "TR-29", "Province"), + ("Hakkari", "TR-30", "Province"), + ("Hatay", "TR-31", "Province"), + ("Isparta", "TR-32", "Province"), + ("Mersin", "TR-33", "Province"), + ("İstanbul", "TR-34", "Province"), + ("İzmir", "TR-35", "Province"), + ("Kars", "TR-36", "Province"), + ("Kastamonu", "TR-37", "Province"), + ("Kayseri", "TR-38", "Province"), + ("Kırklareli", "TR-39", "Province"), + ("Kırşehir", "TR-40", "Province"), + ("Kocaeli", "TR-41", "Province"), + ("Konya", "TR-42", "Province"), + ("Kütahya", "TR-43", "Province"), + ("Malatya", "TR-44", "Province"), + ("Manisa", "TR-45", "Province"), + ("Kahramanmaraş", "TR-46", "Province"), + ("Mardin", "TR-47", "Province"), + ("Muğla", "TR-48", "Province"), + ("Muş", "TR-49", "Province"), + ("Nevşehir", "TR-50", "Province"), + ("Niğde", "TR-51", "Province"), + ("Ordu", "TR-52", "Province"), + ("Rize", "TR-53", "Province"), + ("Sakarya", "TR-54", "Province"), + ("Samsun", "TR-55", "Province"), + ("Siirt", "TR-56", "Province"), + ("Sinop", "TR-57", "Province"), + ("Sivas", "TR-58", "Province"), + ("Tekirdağ", "TR-59", "Province"), + ("Tokat", "TR-60", "Province"), + ("Trabzon", "TR-61", "Province"), + ("Tunceli", "TR-62", "Province"), + ("Şanlıurfa", "TR-63", "Province"), + ("Uşak", "TR-64", "Province"), + ("Van", "TR-65", "Province"), + ("Yozgat", "TR-66", "Province"), + ("Zonguldak", "TR-67", "Province"), + ("Aksaray", "TR-68", "Province"), + ("Bayburt", "TR-69", "Province"), + ("Karaman", "TR-70", "Province"), + ("Kırıkkale", "TR-71", "Province"), + ("Batman", "TR-72", "Province"), + ("Şırnak", "TR-73", "Province"), + ("Bartın", "TR-74", "Province"), + ("Ardahan", "TR-75", "Province"), + ("Iğdır", "TR-76", "Province"), + ("Yalova", "TR-77", "Province"), + ("Karabük", "TR-78", "Province"), + ("Kilis", "TR-79", "Province"), + ("Osmaniye", "TR-80", "Province"), + ("Düzce", "TR-81", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTurkey() + { + 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/TurkmenistanTest.cs b/src/World.Net.UnitTests/Countries/TurkmenistanTest.cs new file mode 100644 index 0000000..13ac426 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TurkmenistanTest.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class TurkmenistanTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Turkmenistan"; + private const string NATIVE_NAME = "Türkmenistan"; + private const string CAPITAL = "Ashgabat"; + private const string OFFICIAL_NAME = "Turkmenistan"; + private const string ISO2_CODE = "TM"; + private const string ISO3_CODE = "TKM"; + private const int NUMERIC_CODE = 795; + private readonly string[] CALLING_CODE = ["+993"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Turkmenistan; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Ahal", "TM-A", "Region"), + ("Balkan", "TM-B", "Region"), + ("Dashoguz", "TM-D", "Region"), + ("Lebap", "TM-L", "Region"), + ("Mary", "TM-M", "Region"), + ("Ashgabat", "TM-AŞ", "Capital City") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTurkmenistan() + { + 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/TurksAndCaicosIslandsTest.cs b/src/World.Net.UnitTests/Countries/TurksAndCaicosIslandsTest.cs new file mode 100644 index 0000000..ad657d5 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TurksAndCaicosIslandsTest.cs @@ -0,0 +1,36 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class TurksAndCaicosIslandsTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Turks and Caicos Islands"; + private const string NATIVE_NAME = "Turks and Caicos Islands"; + private const string CAPITAL = "Cockburn Town"; + private const string OFFICIAL_NAME = "Turks and Caicos Islands"; + private const string ISO2_CODE = "TC"; + private const string ISO3_CODE = "TCA"; + private const int NUMERIC_CODE = 796; + private readonly string[] CALLING_CODE = ["+1-649"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.TurksAndCaicosIslands; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTurksAndCaicosIslands() + { + 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/TuvaluTest.cs b/src/World.Net.UnitTests/Countries/TuvaluTest.cs new file mode 100644 index 0000000..339b90a --- /dev/null +++ b/src/World.Net.UnitTests/Countries/TuvaluTest.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class TuvaluTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Tuvalu"; + private const string NATIVE_NAME = "Tuvalu"; + private const string CAPITAL = "Funafuti"; + private const string OFFICIAL_NAME = "Tuvalu"; + private const string ISO2_CODE = "TV"; + private const string ISO3_CODE = "TUV"; + private const int NUMERIC_CODE = 798; + private readonly string[] CALLING_CODE = ["+688"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tuvalu; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Funafuti", "TV-FUN", "Island"), + ("Nanumea", "TV-NAN", "Island"), + ("Nanumanga", "TV-NMG", "Island"), + ("Niutao", "TV-NT", "Island"), + ("Nui", "TV-NUI", "Island"), + ("Nukufetau", "TV-NKF", "Island"), + ("Nukulaelae", "TV-NKL", "Island"), + ("Vaitupu", "TV-VAI", "Island"), + ("Nukulaelae", "TV-NKL", "Island") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForTuvalu() + { + 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/Taiwan.cs b/src/World.Net/Countries/Taiwan.cs new file mode 100644 index 0000000..815fc10 --- /dev/null +++ b/src/World.Net/Countries/Taiwan.cs @@ -0,0 +1,49 @@ +namespace World.Net.Countries; + +internal sealed class Taiwan : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Taiwan; + + public string Name { get; } = "Taiwan"; + + public string OfficialName { get; } = "Republic of China (Taiwan)"; + + public string NativeName => "臺灣"; + + public string Capital { get; } = "Taipei"; + + public int NumericCode { get; } = 158; + + public string ISO2Code { get; } = "TW"; + + public string ISO3Code { get; } = "TWN"; + + public string[] CallingCode { get; } = ["+886"]; + + public IEnumerable States => new[] + { + new State("Taipei", "TW-TPE", "Municipality"), + new State("New Taipei", "TW-NWT", "Municipality"), + new State("Taoyuan", "TW-TAO", "Municipality"), + new State("Taichung", "TW-TXG", "Municipality"), + new State("Tainan", "TW-TNN", "Municipality"), + new State("Kaohsiung", "TW-KHH", "Municipality"), + new State("Keelung", "TW-KEE", "City"), + new State("Hsinchu", "TW-HSZ", "City"), + new State("Chiayi", "TW-CYI", "City"), + new State("Changhua", "TW-CWH", "County"), + new State("Chiayi County", "TW-CYQ", "County"), + new State("Hsinchu County", "TW-HSQ", "County"), + new State("Hualien", "TW-HWA", "County"), + new State("Kaohsiung County", "TW-KAQ", "County"), + new State("Miaoli", "TW-MIA", "County"), + new State("Nantou", "TW-NAN", "County"), + new State("Penghu", "TW-PEN", "County"), + new State("Pingtung", "TW-PIF", "County"), + new State("Yilan", "TW-YIL", "County"), + new State("Yunlin", "TW-YUN", "County"), + new State("Taitung", "TW-TTT", "County"), + new State("Lienchiang", "TW-LIE", "County") + }; +} + diff --git a/src/World.Net/Countries/Tajikistan.cs b/src/World.Net/Countries/Tajikistan.cs new file mode 100644 index 0000000..35724ac --- /dev/null +++ b/src/World.Net/Countries/Tajikistan.cs @@ -0,0 +1,32 @@ +namespace World.Net.Countries; + +internal sealed class Tajikistan : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tajikistan; + + public string Name { get; } = "Tajikistan"; + + public string OfficialName { get; } = "Republic of Tajikistan"; + + public string NativeName => "Ҷумҳурии Тоҷикистон"; + + public string Capital { get; } = "Dushanbe"; + + public int NumericCode { get; } = 762; + + public string ISO2Code { get; } = "TJ"; + + public string ISO3Code { get; } = "TJK"; + + public string[] CallingCode { get; } = ["+992"]; + + public IEnumerable States => new[] + { + new State("Sughd", "TJ-SU", "Region"), + new State("Khatlon", "TJ-KT", "Region"), + new State("Gorno-Badakhshan", "TJ-GBAO", "Autonomous Region"), + new State("Districts of Republican Subordination", "TJ-DRS", "Region"), + new State("Dushanbe", "TJ-DU", "Capital District") + }; +} + diff --git a/src/World.Net/Countries/Tanzania.cs b/src/World.Net/Countries/Tanzania.cs new file mode 100644 index 0000000..3bfdaff --- /dev/null +++ b/src/World.Net/Countries/Tanzania.cs @@ -0,0 +1,58 @@ +namespace World.Net.Countries; + +internal sealed class Tanzania : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tanzania; + + public string Name { get; } = "Tanzania"; + + public string OfficialName { get; } = "United Republic of Tanzania"; + + public string NativeName => "Jamhuri ya Muungano wa Tanzania"; + + public string Capital { get; } = "Dodoma"; + + public int NumericCode { get; } = 834; + + public string ISO2Code { get; } = "TZ"; + + public string ISO3Code { get; } = "TZA"; + + public string[] CallingCode { get; } = ["+255"]; + + public IEnumerable States => new[] + { + new State("Arusha", "TZ-AR", "Region"), + new State("Dar es Salaam", "TZ-DA", "Region"), + new State("Dodoma", "TZ-DO", "Region"), + new State("Geita", "TZ-GE", "Region"), + new State("Iringa", "TZ-IR", "Region"), + new State("Kagera", "TZ-KA", "Region"), + new State("Katavi", "TZ-KT", "Region"), + new State("Kigoma", "TZ-KI", "Region"), + new State("Kilimanjaro", "TZ-KL", "Region"), + new State("Lindi", "TZ-LI", "Region"), + new State("Manyara", "TZ-MA", "Region"), + new State("Mara", "TZ-MR", "Region"), + new State("Mbeya", "TZ-MB", "Region"), + new State("Morogoro", "TZ-MO", "Region"), + new State("Mtwara", "TZ-MT", "Region"), + new State("Mwanza", "TZ-MW", "Region"), + new State("Njombe", "TZ-NJ", "Region"), + new State("Pwani", "TZ-PW", "Region"), + new State("Rukwa", "TZ-RU", "Region"), + new State("Ruvuma", "TZ-RV", "Region"), + new State("Shinyanga", "TZ-SH", "Region"), + new State("Simiyu", "TZ-SI", "Region"), + new State("Singida", "TZ-SN", "Region"), + new State("Tabora", "TZ-TA", "Region"), + new State("Tanga", "TZ-TE", "Region"), + new State("Songwe", "TZ-SO", "Region"), + new State("Zanzibar North", "TZ-ZN", "Region"), + new State("Zanzibar South", "TZ-ZS", "Region"), + new State("Zanzibar Central/South", "TZ-ZC", "Region"), + new State("Zanzibar West", "TZ-ZW", "Region"), + new State("Zanzibar Urban/West", "TZ-ZU", "Region") + }; +} + diff --git a/src/World.Net/Countries/Thailand.cs b/src/World.Net/Countries/Thailand.cs new file mode 100644 index 0000000..0e36960 --- /dev/null +++ b/src/World.Net/Countries/Thailand.cs @@ -0,0 +1,103 @@ +namespace World.Net.Countries; + +internal sealed class Thailand : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Thailand; + + public string Name { get; } = "Thailand"; + + public string OfficialName { get; } = "Kingdom of Thailand"; + + public string NativeName => "ประเทศไทย"; + + public string Capital { get; } = "Bangkok"; + + public int NumericCode { get; } = 764; + + public string ISO2Code { get; } = "TH"; + + public string ISO3Code { get; } = "THA"; + + public string[] CallingCode { get; } = ["+66"]; + + public IEnumerable States => new[] + { + new State("Amnat Charoen", "TH-37", "Province"), + new State("Ang Thong", "TH-15", "Province"), + new State("Bangkok", "TH-10", "Province"), + new State("Bueng Kan", "TH-38", "Province"), + new State("Buri Ram", "TH-31", "Province"), + new State("Chachoengsao", "TH-24", "Province"), + new State("Chai Nat", "TH-18", "Province"), + new State("Chaiyaphum", "TH-36", "Province"), + new State("Chanthaburi", "TH-22", "Province"), + new State("Chiang Mai", "TH-50", "Province"), + new State("Chiang Rai", "TH-57", "Province"), + new State("Chonburi", "TH-20", "Province"), + new State("Chumphon", "TH-86", "Province"), + new State("Kalasin", "TH-46", "Province"), + new State("Kamphaeng Phet", "TH-62", "Province"), + new State("Kanchanaburi", "TH-71", "Province"), + new State("Khon Kaen", "TH-40", "Province"), + new State("Krabi", "TH-81", "Province"), + new State("Lampang", "TH-52", "Province"), + new State("Lamphun", "TH-51", "Province"), + new State("Loei", "TH-42", "Province"), + new State("Lopburi", "TH-16", "Province"), + new State("Mae Hong Son", "TH-58", "Province"), + new State("Maha Sarakham", "TH-44", "Province"), + new State("Mukdahan", "TH-49", "Province"), + new State("Nakhon Nayok", "TH-26", "Province"), + new State("Nakhon Pathom", "TH-73", "Province"), + new State("Nakhon Phanom", "TH-48", "Province"), + new State("Nakhon Ratchasima", "TH-30", "Province"), + new State("Nakhon Sawan", "TH-60", "Province"), + new State("Nakhon Si Thammarat", "TH-80", "Province"), + new State("Nan", "TH-55", "Province"), + new State("Narathiwat", "TH-96", "Province"), + new State("Nong Bua Lamphu", "TH-39", "Province"), + new State("Nong Khai", "TH-43", "Province"), + new State("Nonthaburi", "TH-12", "Province"), + new State("Pathum Thani", "TH-13", "Province"), + new State("Pattani", "TH-94", "Province"), + new State("Phang Nga", "TH-82", "Province"), + new State("Phatthalung", "TH-93", "Province"), + new State("Phayao", "TH-56", "Province"), + new State("Phetchabun", "TH-67", "Province"), + new State("Phetchaburi", "TH-76", "Province"), + new State("Phichit", "TH-66", "Province"), + new State("Phitsanulok", "TH-65", "Province"), + new State("Phra Nakhon Si Ayutthaya", "TH-14", "Province"), + new State("Phrae", "TH-54", "Province"), + new State("Phuket", "TH-83", "Province"), + new State("Prachinburi", "TH-25", "Province"), + new State("Prachuap Khiri Khan", "TH-77", "Province"), + new State("Ranong", "TH-85", "Province"), + new State("Ratchaburi", "TH-70", "Province"), + new State("Rayong", "TH-21", "Province"), + new State("Roi Et", "TH-45", "Province"), + new State("Sa Kaeo", "TH-27", "Province"), + new State("Sakon Nakhon", "TH-47", "Province"), + new State("Samut Prakan", "TH-11", "Province"), + new State("Samut Sakhon", "TH-74", "Province"), + new State("Samut Songkhram", "TH-75", "Province"), + new State("Saraburi", "TH-19", "Province"), + new State("Satun", "TH-91", "Province"), + new State("Sing Buri", "TH-17", "Province"), + new State("Si Sa Ket", "TH-33", "Province"), + new State("Songkhla", "TH-90", "Province"), + new State("Sukhothai", "TH-64", "Province"), + new State("Suphan Buri", "TH-72", "Province"), + new State("Surat Thani", "TH-84", "Province"), + new State("Tak", "TH-63", "Province"), + new State("Trang", "TH-92", "Province"), + new State("Trat", "TH-23", "Province"), + new State("Ubon Ratchathani", "TH-34", "Province"), + new State("Udon Thani", "TH-41", "Province"), + new State("Uthai Thani", "TH-61", "Province"), + new State("Uttaradit", "TH-53", "Province"), + new State("Yala", "TH-95", "Province"), + new State("Yasothon", "TH-35", "Province") + }; +} + diff --git a/src/World.Net/Countries/TheGambia.cs b/src/World.Net/Countries/TheGambia.cs new file mode 100644 index 0000000..09cc6ce --- /dev/null +++ b/src/World.Net/Countries/TheGambia.cs @@ -0,0 +1,33 @@ +namespace World.Net.Countries; + +internal sealed class TheGambia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Gambia; + + public string Name { get; } = "The Gambia"; + + public string OfficialName { get; } = "Republic of The Gambia"; + + public string NativeName => "The Gambia"; + + public string Capital { get; } = "Banjul"; + + public int NumericCode { get; } = 270; + + public string ISO2Code { get; } = "GM"; + + public string ISO3Code { get; } = "GMB"; + + public string[] CallingCode { get; } = ["+220"]; + + public IEnumerable States => new[] + { + new State("Banjul", "GM-B", "City"), + new State("Central River", "GM-CR", "Region"), + new State("Lower River", "GM-LR", "Region"), + new State("North Bank", "GM-NB", "Region"), + new State("Upper River", "GM-UR", "Region"), + new State("Western", "GM-W", "Region") + }; +} + diff --git a/src/World.Net/Countries/Togo.cs b/src/World.Net/Countries/Togo.cs new file mode 100644 index 0000000..d109400 --- /dev/null +++ b/src/World.Net/Countries/Togo.cs @@ -0,0 +1,32 @@ +namespace World.Net.Countries; + +internal sealed class Togo : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Togo; + + public string Name { get; } = "Togo"; + + public string OfficialName { get; } = "Togolese Republic"; + + public string NativeName => "Togo"; + + public string Capital { get; } = "Lomé"; + + public int NumericCode { get; } = 768; + + public string ISO2Code { get; } = "TG"; + + public string ISO3Code { get; } = "TGO"; + + public string[] CallingCode { get; } = ["+228"]; + + public IEnumerable States => new[] + { + new State("Centrale", "TG-C", "Region"), + new State("Kara", "TG-K", "Region"), + new State("Maritime", "TG-M", "Region"), + new State("Plateaux", "TG-P", "Region"), + new State("Savanes", "TG-S", "Region") + }; +} + diff --git a/src/World.Net/Countries/Tokelau.cs b/src/World.Net/Countries/Tokelau.cs new file mode 100644 index 0000000..49b3b8d --- /dev/null +++ b/src/World.Net/Countries/Tokelau.cs @@ -0,0 +1,30 @@ +namespace World.Net.Countries; + +internal sealed class Tokelau : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tokelau; + + public string Name { get; } = "Tokelau"; + + public string OfficialName { get; } = "Tokelau"; + + public string NativeName => "Tokelau"; + + public string Capital { get; } = "Nukunonu"; + + public int NumericCode { get; } = 772; + + public string ISO2Code { get; } = "TK"; + + public string ISO3Code { get; } = "TKL"; + + public string[] CallingCode { get; } = ["+690"]; + + public IEnumerable States => new[] + { + new State("Atafu", "TK-A", "Atoll"), + new State("Nukunonu", "TK-N", "Atoll"), + new State("Fakaofo", "TK-F", "Atoll") + }; +} + diff --git a/src/World.Net/Countries/Tonga.cs b/src/World.Net/Countries/Tonga.cs new file mode 100644 index 0000000..f28a5a5 --- /dev/null +++ b/src/World.Net/Countries/Tonga.cs @@ -0,0 +1,32 @@ +namespace World.Net.Countries; + +internal sealed class Tonga : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tonga; + + public string Name { get; } = "Tonga"; + + public string OfficialName { get; } = "Kingdom of Tonga"; + + public string NativeName => "Tonga"; + + public string Capital { get; } = "Nukuʻalofa"; + + public int NumericCode { get; } = 776; + + public string ISO2Code { get; } = "TO"; + + public string ISO3Code { get; } = "TON"; + + public string[] CallingCode { get; } = ["+676"]; + + public IEnumerable States => new[] + { + new State("Haʻapai", "TO-02", "Division"), + new State("Tongatapu", "TO-01", "Division"), + new State("Vavaʻu", "TO-05", "Division"), + new State("Eua", "TO-03", "Division"), + new State("Niuas", "TO-04", "Division") + }; +} + diff --git a/src/World.Net/Countries/TrinidadAndTobago.cs b/src/World.Net/Countries/TrinidadAndTobago.cs new file mode 100644 index 0000000..209025a --- /dev/null +++ b/src/World.Net/Countries/TrinidadAndTobago.cs @@ -0,0 +1,40 @@ +namespace World.Net.Countries; + +internal sealed class TrinidadAndTobago : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.TrinidadAndTobago; + + public string Name { get; } = "Trinidad and Tobago"; + + public string OfficialName { get; } = "Republic of Trinidad and Tobago"; + + public string NativeName => "Trinidad and Tobago"; + + public string Capital { get; } = "Port of Spain"; + + public int NumericCode { get; } = 780; + + public string ISO2Code { get; } = "TT"; + + public string ISO3Code { get; } = "TTO"; + + public string[] CallingCode { get; } = ["+1-868"]; + + public IEnumerable States => new[] + { + new State("Arima", "TT-ARI", "City"), + new State("Chaguanas", "TT-CHA", "City"), + new State("Couva-Tabaquite-Talparo", "TT-CTT", "Region"), + new State("Diego Martin", "TT-DMN", "Region"), + new State("Mayaro-Rio Claro", "TT-MRC", "Region"), + new State("Penal-Debe", "TT-PDE", "Region"), + new State("Point Fortin", "TT-PFT", "Region"), + new State("Port of Spain", "TT-POS", "City"), + new State("San Fernando", "TT-SFO", "City"), + new State("San Juan-Laventille", "TT-SJL", "Region"), + new State("Sangre Grande", "TT-SGE", "Region"), + new State("Siparia", "TT-SIP", "Region"), + new State("Tunapuna-Piarco", "TT-TUP", "Region"), + new State("Tobago", "TT-TOB", "Region") + }; +} diff --git a/src/World.Net/Countries/Tunisia.cs b/src/World.Net/Countries/Tunisia.cs new file mode 100644 index 0000000..89ee00b --- /dev/null +++ b/src/World.Net/Countries/Tunisia.cs @@ -0,0 +1,50 @@ +namespace World.Net.Countries; + +internal sealed class Tunisia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tunisia; + + public string Name { get; } = "Tunisia"; + + public string OfficialName { get; } = "Republic of Tunisia"; + + public string NativeName => "تونس"; + + public string Capital { get; } = "Tunis"; + + public int NumericCode { get; } = 788; + + public string ISO2Code { get; } = "TN"; + + public string ISO3Code { get; } = "TUN"; + + public string[] CallingCode { get; } = ["+216"]; + + public IEnumerable States => new[] + { + new State("Ariana", "TN-12", "Governorate"), + new State("Beja", "TN-31", "Governorate"), + new State("Ben Arous", "TN-13", "Governorate"), + new State("Bizerte", "TN-23", "Governorate"), + new State("Gabes", "TN-81", "Governorate"), + new State("Gafsa", "TN-71", "Governorate"), + new State("Jendouba", "TN-32", "Governorate"), + new State("Kairouan", "TN-41", "Governorate"), + new State("Kasserine", "TN-42", "Governorate"), + new State("Kebili", "TN-73", "Governorate"), + new State("Kef", "TN-33", "Governorate"), + new State("Mahdia", "TN-53", "Governorate"), + new State("Manouba", "TN-14", "Governorate"), + new State("Medenine", "TN-82", "Governorate"), + new State("Monastir", "TN-52", "Governorate"), + new State("Nabeul", "TN-21", "Governorate"), + new State("Sfax", "TN-81", "Governorate"), + new State("Sidi Bouzid", "TN-43", "Governorate"), + new State("Siliana", "TN-34", "Governorate"), + new State("Sousse", "TN-51", "Governorate"), + new State("Tataouine", "TN-83", "Governorate"), + new State("Tozeur", "TN-72", "Governorate"), + new State("Tunis", "TN-11", "Governorate"), + new State("Zaghouan", "TN-22", "Governorate") + }; +} diff --git a/src/World.Net/Countries/Turkey.cs b/src/World.Net/Countries/Turkey.cs new file mode 100644 index 0000000..2ca990a --- /dev/null +++ b/src/World.Net/Countries/Turkey.cs @@ -0,0 +1,108 @@ +namespace World.Net.Countries; + +internal sealed class Turkey : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Turkey; + + public string Name { get; } = "Turkey"; + + public string OfficialName { get; } = "Republic of Turkey"; + + public string NativeName => "Türkiye"; + + public string Capital { get; } = "Ankara"; + + public int NumericCode { get; } = 792; + + public string ISO2Code { get; } = "TR"; + + public string ISO3Code { get; } = "TUR"; + + public string[] CallingCode { get; } = ["+90"]; + + public IEnumerable States => new[] + { + new State("Adana", "TR-01", "Province"), + new State("Adıyaman", "TR-02", "Province"), + new State("Afyonkarahisar", "TR-03", "Province"), + new State("Ağrı", "TR-04", "Province"), + new State("Amasya", "TR-05", "Province"), + new State("Ankara", "TR-06", "Province"), + new State("Antalya", "TR-07", "Province"), + new State("Artvin", "TR-08", "Province"), + new State("Aydın", "TR-09", "Province"), + new State("Balıkesir", "TR-10", "Province"), + new State("Bilecik", "TR-11", "Province"), + new State("Bingöl", "TR-12", "Province"), + new State("Bitlis", "TR-13", "Province"), + new State("Bolu", "TR-14", "Province"), + new State("Burdur", "TR-15", "Province"), + new State("Bursa", "TR-16", "Province"), + new State("Çanakkale", "TR-17", "Province"), + new State("Çankırı", "TR-18", "Province"), + new State("Çorum", "TR-19", "Province"), + new State("Denizli", "TR-20", "Province"), + new State("Diyarbakır", "TR-21", "Province"), + new State("Edirne", "TR-22", "Province"), + new State("Elazığ", "TR-23", "Province"), + new State("Erzincan", "TR-24", "Province"), + new State("Erzurum", "TR-25", "Province"), + new State("Eskişehir", "TR-26", "Province"), + new State("Gaziantep", "TR-27", "Province"), + new State("Giresun", "TR-28", "Province"), + new State("Gümüşhane", "TR-29", "Province"), + new State("Hakkari", "TR-30", "Province"), + new State("Hatay", "TR-31", "Province"), + new State("Isparta", "TR-32", "Province"), + new State("Mersin", "TR-33", "Province"), + new State("İstanbul", "TR-34", "Province"), + new State("İzmir", "TR-35", "Province"), + new State("Kars", "TR-36", "Province"), + new State("Kastamonu", "TR-37", "Province"), + new State("Kayseri", "TR-38", "Province"), + new State("Kırklareli", "TR-39", "Province"), + new State("Kırşehir", "TR-40", "Province"), + new State("Kocaeli", "TR-41", "Province"), + new State("Konya", "TR-42", "Province"), + new State("Kütahya", "TR-43", "Province"), + new State("Malatya", "TR-44", "Province"), + new State("Manisa", "TR-45", "Province"), + new State("Kahramanmaraş", "TR-46", "Province"), + new State("Mardin", "TR-47", "Province"), + new State("Muğla", "TR-48", "Province"), + new State("Muş", "TR-49", "Province"), + new State("Nevşehir", "TR-50", "Province"), + new State("Niğde", "TR-51", "Province"), + new State("Ordu", "TR-52", "Province"), + new State("Rize", "TR-53", "Province"), + new State("Sakarya", "TR-54", "Province"), + new State("Samsun", "TR-55", "Province"), + new State("Siirt", "TR-56", "Province"), + new State("Sinop", "TR-57", "Province"), + new State("Sivas", "TR-58", "Province"), + new State("Tekirdağ", "TR-59", "Province"), + new State("Tokat", "TR-60", "Province"), + new State("Trabzon", "TR-61", "Province"), + new State("Tunceli", "TR-62", "Province"), + new State("Şanlıurfa", "TR-63", "Province"), + new State("Uşak", "TR-64", "Province"), + new State("Van", "TR-65", "Province"), + new State("Yozgat", "TR-66", "Province"), + new State("Zonguldak", "TR-67", "Province"), + new State("Aksaray", "TR-68", "Province"), + new State("Bayburt", "TR-69", "Province"), + new State("Karaman", "TR-70", "Province"), + new State("Kırıkkale", "TR-71", "Province"), + new State("Batman", "TR-72", "Province"), + new State("Şırnak", "TR-73", "Province"), + new State("Bartın", "TR-74", "Province"), + new State("Ardahan", "TR-75", "Province"), + new State("Iğdır", "TR-76", "Province"), + new State("Yalova", "TR-77", "Province"), + new State("Karabük", "TR-78", "Province"), + new State("Kilis", "TR-79", "Province"), + new State("Osmaniye", "TR-80", "Province"), + new State("Düzce", "TR-81", "Province") + }; +} + diff --git a/src/World.Net/Countries/Turkmenistan.cs b/src/World.Net/Countries/Turkmenistan.cs new file mode 100644 index 0000000..89e2470 --- /dev/null +++ b/src/World.Net/Countries/Turkmenistan.cs @@ -0,0 +1,33 @@ +namespace World.Net.Countries; + +internal sealed class Turkmenistan : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Turkmenistan; + + public string Name { get; } = "Turkmenistan"; + + public string OfficialName { get; } = "Turkmenistan"; + + public string NativeName => "Türkmenistan"; + + public string Capital { get; } = "Ashgabat"; + + public int NumericCode { get; } = 795; + + public string ISO2Code { get; } = "TM"; + + public string ISO3Code { get; } = "TKM"; + + public string[] CallingCode { get; } = ["+993"]; + + public IEnumerable States => new[] + { + new State("Ahal", "TM-A", "Region"), + new State("Balkan", "TM-B", "Region"), + new State("Dashoguz", "TM-D", "Region"), + new State("Lebap", "TM-L", "Region"), + new State("Mary", "TM-M", "Region"), + new State("Ashgabat", "TM-AŞ", "Capital City") + }; +} + diff --git a/src/World.Net/Countries/TurksAndCaicosIslands.cs b/src/World.Net/Countries/TurksAndCaicosIslands.cs new file mode 100644 index 0000000..9919abf --- /dev/null +++ b/src/World.Net/Countries/TurksAndCaicosIslands.cs @@ -0,0 +1,24 @@ +namespace World.Net.Countries; + +internal sealed class TurksAndCaicosIslands : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.TurksAndCaicosIslands; + + public string Name { get; } = "Turks and Caicos Islands"; + + public string OfficialName { get; } = "Turks and Caicos Islands"; + + public string NativeName => "Turks and Caicos Islands"; + + public string Capital { get; } = "Cockburn Town"; + + public int NumericCode { get; } = 796; + + public string ISO2Code { get; } = "TC"; + + public string ISO3Code { get; } = "TCA"; + + public string[] CallingCode { get; } = ["+1-649"]; + + public IEnumerable States => Array.Empty(); +} diff --git a/src/World.Net/Countries/Tuvalu.cs b/src/World.Net/Countries/Tuvalu.cs new file mode 100644 index 0000000..f098e6a --- /dev/null +++ b/src/World.Net/Countries/Tuvalu.cs @@ -0,0 +1,35 @@ +namespace World.Net.Countries; + +internal sealed class Tuvalu : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Tuvalu; + + public string Name { get; } = "Tuvalu"; + + public string OfficialName { get; } = "Tuvalu"; + + public string NativeName => "Tuvalu"; + + public string Capital { get; } = "Funafuti"; + + public int NumericCode { get; } = 798; + + public string ISO2Code { get; } = "TV"; + + public string ISO3Code { get; } = "TUV"; + + public string[] CallingCode { get; } = ["+688"]; + + public IEnumerable States => new[] + { + new State("Funafuti", "TV-FUN", "Island"), + new State("Nanumea", "TV-NAN", "Island"), + new State("Nanumanga", "TV-NMG", "Island"), + new State("Niutao", "TV-NT", "Island"), + new State("Nui", "TV-NUI", "Island"), + new State("Nukufetau", "TV-NKF", "Island"), + new State("Nukulaelae", "TV-NKL", "Island"), + new State("Vaitupu", "TV-VAI", "Island"), + new State("Nukulaelae", "TV-NKL", "Island") + }; +} diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 756b390..32a8b27 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -70,7 +70,6 @@ public static Dictionary Initialize() { CountryIdentifier.Djibouti, new Djibouti() }, { CountryIdentifier.Dominica, new Dominica() }, { CountryIdentifier.DominicanRepublic, new DominicanRepublic() }, - { CountryIdentifier.TimorLeste, new TimorLeste() }, { CountryIdentifier.Ecuador, new Ecuador() }, { CountryIdentifier.Egypt, new Egypt() }, { CountryIdentifier.ElSalvador, new ElSalvador() }, @@ -87,6 +86,7 @@ public static Dictionary Initialize() { CountryIdentifier.FrenchGuiana, new FrenchGuiana() }, { CountryIdentifier.FrenchPolynesia, new FrenchPolynesia() }, { CountryIdentifier.Gabon, new Gabon() }, + { CountryIdentifier.Gambia, new TheGambia() }, { CountryIdentifier.Georgia, new Georgia() }, { CountryIdentifier.Germany, new Germany() }, { CountryIdentifier.Ghana, new Ghana() }, @@ -193,6 +193,19 @@ public static Dictionary Initialize() { CountryIdentifier.Sweden, new Sweden() }, { CountryIdentifier.Switzerland, new Switzerland() }, { CountryIdentifier.Syria, new Syria() }, + { CountryIdentifier.Taiwan, new Taiwan() }, + { CountryIdentifier.Tajikistan, new Tajikistan() }, + { CountryIdentifier.Tanzania, new Tanzania() }, + { CountryIdentifier.TimorLeste, new TimorLeste() }, + { CountryIdentifier.Togo, new Togo() }, + { CountryIdentifier.Tokelau, new Tokelau() }, + { CountryIdentifier.Tonga, new Tonga() }, + { CountryIdentifier.TrinidadAndTobago, new TrinidadAndTobago() }, + { CountryIdentifier.Tunisia, new Tunisia() }, + { CountryIdentifier.Turkey, new Turkey() }, + { CountryIdentifier.Turkmenistan, new Turkmenistan() }, + { CountryIdentifier.TurksAndCaicosIslands, new TurksAndCaicosIslands() }, + { CountryIdentifier.Tuvalu, new Tuvalu() }, // Future countries can be added here in the same format. }; From 4c49f56b8ffd0139c61afcb6421745de83841714 Mon Sep 17 00:00:00 2001 From: IDAM Date: Fri, 19 Dec 2025 10:21:52 +0100 Subject: [PATCH 2/3] updated country initializer --- src/World.Net/Helpers/CountryInitializer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 32a8b27..534157b 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -196,6 +196,7 @@ public static Dictionary Initialize() { CountryIdentifier.Taiwan, new Taiwan() }, { CountryIdentifier.Tajikistan, new Tajikistan() }, { CountryIdentifier.Tanzania, new Tanzania() }, + { CountryIdentifier.Thailand, new Thailand() }, { CountryIdentifier.TimorLeste, new TimorLeste() }, { CountryIdentifier.Togo, new Togo() }, { CountryIdentifier.Tokelau, new Tokelau() }, From 5066905dcbb116ec0f84807330661593a69bd1f2 Mon Sep 17 00:00:00 2001 From: IDAM Date: Fri, 19 Dec 2025 11:31:27 +0100 Subject: [PATCH 3/3] added details for more countries --- .../Countries/UgandaTest.cs | 42 +++++++ .../Countries/UkraineTest.cs | 65 +++++++++++ .../Countries/UnitedArabEmiratesTest.cs | 53 +++++++++ .../Countries/UnitedKingdomTest.cs | 50 ++++++++ .../UnitedStatesMinorOutlyingIslandsTest.cs | 44 +++++++ .../Countries/UnitedStatesTest.cs | 97 ++++++++++++++++ .../Countries/UruguayTest.cs | 65 +++++++++++ .../Countries/UzbekistanTest.cs | 60 ++++++++++ .../Countries/VanuatuTest.cs | 52 +++++++++ .../Countries/VaticanCityTest.cs | 44 +++++++ .../Countries/VenezuelaTest.cs | 70 +++++++++++ .../Countries/VietnamTest.cs | 109 ++++++++++++++++++ .../Countries/VirginIslandsBritishTest.cs | 44 +++++++ .../Countries/VirginIslandsUSTest.cs | 44 +++++++ .../Countries/WallisAndFutunaTest.cs | 49 ++++++++ .../Countries/WesternSaharaTest.cs | 44 +++++++ .../Countries/YemenTest.cs | 66 +++++++++++ .../Countries/ZambiaTest.cs | 56 +++++++++ .../Countries/ZimbabweTest.cs | 56 +++++++++ src/World.Net/Countries/Uganda.cs | 31 +++++ src/World.Net/Countries/Ukraine.cs | 54 +++++++++ src/World.Net/Countries/UnitedArabEmirates.cs | 34 ++++++ src/World.Net/Countries/UnitedKingdom.cs | 31 +++++ src/World.Net/Countries/UnitedStates.cs | 78 +++++++++++++ .../UnitedStatesMinorOutlyingIslands.cs | 24 ++++ src/World.Net/Countries/Uruguay.cs | 46 ++++++++ src/World.Net/Countries/Uzbekistan.cs | 41 +++++++ src/World.Net/Countries/Vanuatu.cs | 33 ++++++ src/World.Net/Countries/VaticanCity.cs | 25 ++++ src/World.Net/Countries/Venezuela.cs | 50 ++++++++ src/World.Net/Countries/Vietnam.cs | 90 +++++++++++++++ .../Countries/VirginIslandsBritish.cs | 24 ++++ src/World.Net/Countries/VirginIslandsUS.cs | 25 ++++ src/World.Net/Countries/WallisAndFutuna.cs | 30 +++++ src/World.Net/Countries/WesternSahara.cs | 25 ++++ src/World.Net/Countries/Yemen.cs | 47 ++++++++ src/World.Net/Countries/Zambia.cs | 36 ++++++ src/World.Net/Countries/Zimbabwe.cs | 37 ++++++ src/World.Net/Helpers/CountryInitializer.cs | 19 +++ 39 files changed, 1890 insertions(+) create mode 100644 src/World.Net.UnitTests/Countries/UgandaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UkraineTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UnitedArabEmiratesTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UnitedKingdomTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UnitedStatesMinorOutlyingIslandsTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UnitedStatesTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UruguayTest.cs create mode 100644 src/World.Net.UnitTests/Countries/UzbekistanTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VanuatuTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VaticanCityTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VenezuelaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VietnamTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VirginIslandsBritishTest.cs create mode 100644 src/World.Net.UnitTests/Countries/VirginIslandsUSTest.cs create mode 100644 src/World.Net.UnitTests/Countries/WallisAndFutunaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/WesternSaharaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/YemenTest.cs create mode 100644 src/World.Net.UnitTests/Countries/ZambiaTest.cs create mode 100644 src/World.Net.UnitTests/Countries/ZimbabweTest.cs create mode 100644 src/World.Net/Countries/Uganda.cs create mode 100644 src/World.Net/Countries/Ukraine.cs create mode 100644 src/World.Net/Countries/UnitedArabEmirates.cs create mode 100644 src/World.Net/Countries/UnitedKingdom.cs create mode 100644 src/World.Net/Countries/UnitedStates.cs create mode 100644 src/World.Net/Countries/UnitedStatesMinorOutlyingIslands.cs create mode 100644 src/World.Net/Countries/Uruguay.cs create mode 100644 src/World.Net/Countries/Uzbekistan.cs create mode 100644 src/World.Net/Countries/Vanuatu.cs create mode 100644 src/World.Net/Countries/VaticanCity.cs create mode 100644 src/World.Net/Countries/Venezuela.cs create mode 100644 src/World.Net/Countries/Vietnam.cs create mode 100644 src/World.Net/Countries/VirginIslandsBritish.cs create mode 100644 src/World.Net/Countries/VirginIslandsUS.cs create mode 100644 src/World.Net/Countries/WallisAndFutuna.cs create mode 100644 src/World.Net/Countries/WesternSahara.cs create mode 100644 src/World.Net/Countries/Yemen.cs create mode 100644 src/World.Net/Countries/Zambia.cs create mode 100644 src/World.Net/Countries/Zimbabwe.cs diff --git a/src/World.Net.UnitTests/Countries/UgandaTest.cs b/src/World.Net.UnitTests/Countries/UgandaTest.cs new file mode 100644 index 0000000..95f249a --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UgandaTest.cs @@ -0,0 +1,42 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class UgandaTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Uganda"; + private const string NATIVE_NAME = "Uganda"; + private const string CAPITAL = "Kampala"; + private const string OFFICIAL_NAME = "Republic of Uganda"; + private const string ISO2_CODE = "UG"; + private const string ISO3_CODE = "UGA"; + private const int NUMERIC_CODE = 800; + private readonly string[] CALLING_CODE = ["+256"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Uganda; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Central", "UG-C", "Region"), + ("Eastern", "UG-E", "Region"), + ("Northern", "UG-N", "Region"), + ("Western", "UG-W", "Region") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUganda() + { + 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/UkraineTest.cs b/src/World.Net.UnitTests/Countries/UkraineTest.cs new file mode 100644 index 0000000..5bd2c83 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UkraineTest.cs @@ -0,0 +1,65 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class UkraineTest : AssertCountryTestBase +{ + private const string COUNTRY_NAME = "Ukraine"; + private const string NATIVE_NAME = "Україна"; + private const string CAPITAL = "Kyiv"; + private const string OFFICIAL_NAME = "Ukraine"; + private const string ISO2_CODE = "UA"; + private const string ISO3_CODE = "UKR"; + private const int NUMERIC_CODE = 804; + private readonly string[] CALLING_CODE = ["+380"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Ukraine; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Cherkasy", "UA-CK", "Oblast"), + ("Chernihiv", "UA-CH", "Oblast"), + ("Chernivtsi", "UA-CV", "Oblast"), + ("Dnipropetrovsk", "UA-DP", "Oblast"), + ("Donetsk", "UA-DO", "Oblast"), + ("Ivano-Frankivsk", "UA-IF", "Oblast"), + ("Kharkiv", "UA-KH", "Oblast"), + ("Kherson", "UA-KH", "Oblast"), + ("Khmelnytskyi", "UA-KM", "Oblast"), + ("Kirovohrad", "UA-KR", "Oblast"), + ("Kyiv", "UA-KY", "City"), + ("Kyiv Oblast", "UA-KY", "Oblast"), + ("Luhansk", "UA-LU", "Oblast"), + ("Lviv", "UA-LV", "Oblast"), + ("Mykolaiv", "UA-MK", "Oblast"), + ("Odessa", "UA-OD", "Oblast"), + ("Poltava", "UA-PL", "Oblast"), + ("Rivne", "UA-RV", "Oblast"), + ("Sevastopol", "UA-SE", "City"), + ("Sumy", "UA-SU", "Oblast"), + ("Ternopil", "UA-TE", "Oblast"), + ("Vinnytsia", "UA-VI", "Oblast"), + ("Volyn", "UA-VO", "Oblast"), + ("Zakarpattia", "UA-ZA", "Oblast"), + ("Zaporizhzhia", "UA-ZP", "Oblast"), + ("Zhytomyr", "UA-ZH", "Oblast"), + ("Autonomous Republic of Crimea", "UA-CR", "Autonomous Republic") +}; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUkraine() + { + 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/UnitedArabEmiratesTest.cs b/src/World.Net.UnitTests/Countries/UnitedArabEmiratesTest.cs new file mode 100644 index 0000000..7e0d0b8 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UnitedArabEmiratesTest.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class UnitedArabEmiratesTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "United Arab Emirates"; + private const string NATIVE_NAME = "الإمارات العربية المتحدة"; + private const string CAPITAL = "Abu Dhabi"; + private const string OFFICIAL_NAME = "United Arab Emirates"; + private const string ISO2_CODE = "AE"; + private const string ISO3_CODE = "ARE"; + private const int NUMERIC_CODE = 784; + private readonly string[] CALLING_CODE = ["+971"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedArabEmirates; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Abu Dhabi", "AE-AZ", "Emirate"), + ("Ajman", "AE-AJ", "Emirate"), + ("Dubai", "AE-DU", "Emirate"), + ("Fujairah", "AE-FU", "Emirate"), + ("Ras Al Khaimah", "AE-RK", "Emirate"), + ("Sharjah", "AE-SH", "Emirate"), + ("Umm Al Quwain", "AE-UQ", "Emirate") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUAE() + { + 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/UnitedKingdomTest.cs b/src/World.Net.UnitTests/Countries/UnitedKingdomTest.cs new file mode 100644 index 0000000..b739561 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UnitedKingdomTest.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 UnitedKingdomTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "United Kingdom"; + private const string NATIVE_NAME = "United Kingdom"; + private const string CAPITAL = "London"; + private const string OFFICIAL_NAME = "United Kingdom of Great Britain and Northern Ireland"; + private const string ISO2_CODE = "GB"; + private const string ISO3_CODE = "GBR"; + private const int NUMERIC_CODE = 826; + private readonly string[] CALLING_CODE = ["+44"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedKingdom; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("England", "GB-ENG", "Country"), + ("Scotland", "GB-SCT", "Country"), + ("Wales", "GB-WLS", "Country"), + ("Northern Ireland", "GB-NIR", "Country") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUnitedKingdom() + { + 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/UnitedStatesMinorOutlyingIslandsTest.cs b/src/World.Net.UnitTests/Countries/UnitedStatesMinorOutlyingIslandsTest.cs new file mode 100644 index 0000000..e105e1c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UnitedStatesMinorOutlyingIslandsTest.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class UnitedStatesMinorOutlyingIslandsTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "United States Minor Outlying Islands"; + private const string NATIVE_NAME = "United States Minor Outlying Islands"; + private const string CAPITAL = null; + private const string OFFICIAL_NAME = "United States Minor Outlying Islands"; + private const string ISO2_CODE = "UM"; + private const string ISO3_CODE = "UMI"; + private const int NUMERIC_CODE = 581; + private readonly string[] CALLING_CODE = ["+1"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedStatesMinorOutlyingIslands; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUSMinorOutlyingIslands() + { + 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/UnitedStatesTest.cs b/src/World.Net.UnitTests/Countries/UnitedStatesTest.cs new file mode 100644 index 0000000..66ce117 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UnitedStatesTest.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class UnitedStatesTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "United States"; + private const string NATIVE_NAME = "United States"; + private const string CAPITAL = "Washington, D.C."; + private const string OFFICIAL_NAME = "United States of America"; + private const string ISO2_CODE = "US"; + private const string ISO3_CODE = "USA"; + private const int NUMERIC_CODE = 840; + private readonly string[] CALLING_CODE = ["+1"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedStates; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Alabama", "US-AL", "State"), + ("Alaska", "US-AK", "State"), + ("Arizona", "US-AZ", "State"), + ("Arkansas", "US-AR", "State"), + ("California", "US-CA", "State"), + ("Colorado", "US-CO", "State"), + ("Connecticut", "US-CT", "State"), + ("Delaware", "US-DE", "State"), + ("Florida", "US-FL", "State"), + ("Georgia", "US-GA", "State"), + ("Hawaii", "US-HI", "State"), + ("Idaho", "US-ID", "State"), + ("Illinois", "US-IL", "State"), + ("Indiana", "US-IN", "State"), + ("Iowa", "US-IA", "State"), + ("Kansas", "US-KS", "State"), + ("Kentucky", "US-KY", "State"), + ("Louisiana", "US-LA", "State"), + ("Maine", "US-ME", "State"), + ("Maryland", "US-MD", "State"), + ("Massachusetts", "US-MA", "State"), + ("Michigan", "US-MI", "State"), + ("Minnesota", "US-MN", "State"), + ("Mississippi", "US-MS", "State"), + ("Missouri", "US-MO", "State"), + ("Montana", "US-MT", "State"), + ("Nebraska", "US-NE", "State"), + ("Nevada", "US-NV", "State"), + ("New Hampshire", "US-NH", "State"), + ("New Jersey", "US-NJ", "State"), + ("New Mexico", "US-NM", "State"), + ("New York", "US-NY", "State"), + ("North Carolina", "US-NC", "State"), + ("North Dakota", "US-ND", "State"), + ("Ohio", "US-OH", "State"), + ("Oklahoma", "US-OK", "State"), + ("Oregon", "US-OR", "State"), + ("Pennsylvania", "US-PA", "State"), + ("Rhode Island", "US-RI", "State"), + ("South Carolina", "US-SC", "State"), + ("South Dakota", "US-SD", "State"), + ("Tennessee", "US-TN", "State"), + ("Texas", "US-TX", "State"), + ("Utah", "US-UT", "State"), + ("Vermont", "US-VT", "State"), + ("Virginia", "US-VA", "State"), + ("Washington", "US-WA", "State"), + ("West Virginia", "US-WV", "State"), + ("Wisconsin", "US-WI", "State"), + ("Wyoming", "US-WY", "State"), + ("District of Columbia", "US-DC", "Federal District") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUnitedStates() + { + 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/UruguayTest.cs b/src/World.Net.UnitTests/Countries/UruguayTest.cs new file mode 100644 index 0000000..c5e6a9c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UruguayTest.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class UruguayTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Uruguay"; + private const string NATIVE_NAME = "República Oriental del Uruguay"; + private const string CAPITAL = "Montevideo"; + private const string OFFICIAL_NAME = "Oriental Republic of Uruguay"; + private const string ISO2_CODE = "UY"; + private const string ISO3_CODE = "URY"; + private const int NUMERIC_CODE = 858; + private readonly string[] CALLING_CODE = ["+598"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Uruguay; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Artigas", "UY-AR", "Department"), + ("Canelones", "UY-CA", "Department"), + ("Cerro Largo", "UY-CL", "Department"), + ("Colonia", "UY-CO", "Department"), + ("Durazno", "UY-DU", "Department"), + ("Flores", "UY-FS", "Department"), + ("Florida", "UY-FD", "Department"), + ("Lavalleja", "UY-LA", "Department"), + ("Maldonado", "UY-MA", "Department"), + ("Montevideo", "UY-MO", "Department"), + ("Paysandú", "UY-PA", "Department"), + ("Río Negro", "UY-RN", "Department"), + ("Rivera", "UY-RV", "Department"), + ("Rocha", "UY-RO", "Department"), + ("Salto", "UY-SA", "Department"), + ("San José", "UY-SJ", "Department"), + ("Soriano", "UY-SO", "Department"), + ("Tacuarembó", "UY-TA", "Department"), + ("Treinta y Tres", "UY-TT", "Department") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUruguay() + { + 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/UzbekistanTest.cs b/src/World.Net.UnitTests/Countries/UzbekistanTest.cs new file mode 100644 index 0000000..f636507 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/UzbekistanTest.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 UzbekistanTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Uzbekistan"; + private const string NATIVE_NAME = "Oʻzbekiston Respublikasi"; + private const string CAPITAL = "Tashkent"; + private const string OFFICIAL_NAME = "Republic of Uzbekistan"; + private const string ISO2_CODE = "UZ"; + private const string ISO3_CODE = "UZB"; + private const int NUMERIC_CODE = 860; + private readonly string[] CALLING_CODE = ["+998"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Uzbekistan; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Andijan", "UZ-AN", "Region"), + ("Bukhara", "UZ-BU", "Region"), + ("Fergana", "UZ-FA", "Region"), + ("Jizzakh", "UZ-JI", "Region"), + ("Kashkadarya", "UZ-KA", "Region"), + ("Khorezm", "UZ-KH", "Region"), + ("Namangan", "UZ-NG", "Region"), + ("Navoiy", "UZ-NW", "Region"), + ("Samarkand", "UZ-SA", "Region"), + ("Sirdaryo", "UZ-SI", "Region"), + ("Surxondaryo", "UZ-SU", "Region"), + ("Tashkent Region", "UZ-TO", "Region"), + ("Republic of Karakalpakstan", "UZ-QA", "Autonomous Republic"), + ("Tashkent", "UZ-TK", "City") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForUzbekistan() + { + 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/VanuatuTest.cs b/src/World.Net.UnitTests/Countries/VanuatuTest.cs new file mode 100644 index 0000000..df0bbad --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VanuatuTest.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VanuatuTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Vanuatu"; + private const string NATIVE_NAME = "Ripablik blong Vanuatu"; + private const string CAPITAL = "Port Vila"; + private const string OFFICIAL_NAME = "Republic of Vanuatu"; + private const string ISO2_CODE = "VU"; + private const string ISO3_CODE = "VUT"; + private const int NUMERIC_CODE = 548; + private readonly string[] CALLING_CODE = ["+678"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Vanuatu; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Malampa", "VU-MAP", "Province"), + ("Penama", "VU-PAM", "Province"), + ("Sanma", "VU-SAM", "Province"), + ("Shefa", "VU-SEE", "Province"), + ("Tafea", "VU-TAE", "Province"), + ("Torba", "VU-TOB", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVanuatu() + { + 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/VaticanCityTest.cs b/src/World.Net.UnitTests/Countries/VaticanCityTest.cs new file mode 100644 index 0000000..a41600f --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VaticanCityTest.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VaticanCityTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Vatican City State (Holy See)"; + private const string NATIVE_NAME = "Stato della Città del Vaticano"; + private const string CAPITAL = "Vatican City"; + private const string OFFICIAL_NAME = "Vatican City State"; + private const string ISO2_CODE = "VA"; + private const string ISO3_CODE = "VAT"; + private const int NUMERIC_CODE = 336; + private readonly string[] CALLING_CODE = ["+379"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.VaticanCityState; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVaticanCity() + { + 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/VenezuelaTest.cs b/src/World.Net.UnitTests/Countries/VenezuelaTest.cs new file mode 100644 index 0000000..76d2c94 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VenezuelaTest.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VenezuelaTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Venezuela"; + private const string NATIVE_NAME = "República Bolivariana de Venezuela"; + private const string CAPITAL = "Caracas"; + private const string OFFICIAL_NAME = "Bolivarian Republic of Venezuela"; + private const string ISO2_CODE = "VE"; + private const string ISO3_CODE = "VEN"; + private const int NUMERIC_CODE = 862; + private readonly string[] CALLING_CODE = ["+58"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Venezuela; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Amazonas", "VE-Z", "State"), + ("Anzoátegui", "VE-B", "State"), + ("Apure", "VE-C", "State"), + ("Aragua", "VE-D", "State"), + ("Barinas", "VE-E", "State"), + ("Bolívar", "VE-F", "State"), + ("Carabobo", "VE-G", "State"), + ("Cojedes", "VE-H", "State"), + ("Delta Amacuro", "VE-Y", "State"), + ("Falcón", "VE-I", "State"), + ("Guárico", "VE-J", "State"), + ("Lara", "VE-K", "State"), + ("Mérida", "VE-L", "State"), + ("Miranda", "VE-M", "State"), + ("Monagas", "VE-N", "State"), + ("Nueva Esparta", "VE-O", "State"), + ("Portuguesa", "VE-P", "State"), + ("Sucre", "VE-R", "State"), + ("Táchira", "VE-S", "State"), + ("Trujillo", "VE-T", "State"), + ("Vargas", "VE-X", "State"), + ("Yaracuy", "VE-U", "State"), + ("Zulia", "VE-V", "State"), + ("Capital District", "VE-DC", "Capital District") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVenezuela() + { + 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/VietnamTest.cs b/src/World.Net.UnitTests/Countries/VietnamTest.cs new file mode 100644 index 0000000..59cb946 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VietnamTest.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VietnamTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Vietnam"; + private const string NATIVE_NAME = "Cộng hòa Xã hội Chủ nghĩa Việt Nam"; + private const string CAPITAL = "Hanoi"; + private const string OFFICIAL_NAME = "Socialist Republic of Vietnam"; + private const string ISO2_CODE = "VN"; + private const string ISO3_CODE = "VNM"; + private const int NUMERIC_CODE = 704; + private readonly string[] CALLING_CODE = ["+84"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Vietnam; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("An Giang", "VN-44", "Province"), + ("Bà Rịa–Vũng Tàu", "VN-43", "Province"), + ("Bắc Giang", "VN-54", "Province"), + ("Bắc Kạn", "VN-53", "Province"), + ("Bạc Liêu", "VN-50", "Province"), + ("Bắc Ninh", "VN-56", "Province"), + ("Bến Tre", "VN-51", "Province"), + ("Bình Định", "VN-31", "Province"), + ("Bình Dương", "VN-74", "Province"), + ("Bình Phước", "VN-70", "Province"), + ("Bình Thuận", "VN-40", "Province"), + ("Cà Mau", "VN-49", "Province"), + ("Cần Thơ", "VN-CT", "Municipality"), + ("Cao Bằng", "VN-04", "Province"), + ("Đà Nẵng", "VN-DN", "Municipality"), + ("Đắk Lắk", "VN-33", "Province"), + ("Đắk Nông", "VN-72", "Province"), + ("Điện Biên", "VN-11", "Province"), + ("Đồng Nai", "VN-75", "Province"), + ("Đồng Tháp", "VN-67", "Province"), + ("Gia Lai", "VN-30", "Province"), + ("Hà Giang", "VN-02", "Province"), + ("Hà Nam", "VN-63", "Province"), + ("Hà Nội", "VN-HN", "Municipality"), + ("Hà Tĩnh", "VN-24", "Province"), + ("Hải Dương", "VN-61", "Province"), + ("Hải Phòng", "VN-HP", "Municipality"), + ("Hậu Giang", "VN-64", "Province"), + ("Hòa Bình", "VN-14", "Province"), + ("Hưng Yên", "VN-66", "Province"), + ("Khánh Hòa", "VN-34", "Province"), + ("Kiên Giang", "VN-47", "Province"), + ("Kon Tum", "VN-28", "Province"), + ("Lai Châu", "VN-12", "Province"), + ("Lâm Đồng", "VN-35", "Province"), + ("Lạng Sơn", "VN-20", "Province"), + ("Lào Cai", "VN-10", "Province"), + ("Long An", "VN-41", "Province"), + ("Nam Định", "VN-67", "Province"), + ("Nghệ An", "VN-28", "Province"), + ("Ninh Bình", "VN-18", "Province"), + ("Ninh Thuận", "VN-36", "Province"), + ("Phú Thọ", "VN-68", "Province"), + ("Phú Yên", "VN-32", "Province"), + ("Quảng Bình", "VN-23", "Province"), + ("Quảng Nam", "VN-27", "Province"), + ("Quảng Ngãi", "VN-29", "Province"), + ("Quảng Ninh", "VN-22", "Province"), + ("Quảng Trị", "VN-25", "Province"), + ("Sóc Trăng", "VN-52", "Province"), + ("Sơn La", "VN-15", "Province"), + ("Tây Ninh", "VN-37", "Province"), + ("Thái Bình", "VN-60", "Province"), + ("Thái Nguyên", "VN-19", "Province"), + ("Thanh Hóa", "VN-21", "Province"), + ("Thừa Thiên–Huế", "VN-26", "Province"), + ("Tiền Giang", "VN-42", "Province"), + ("TP Hồ Chí Minh", "VN-HCM", "Municipality"), + ("Trà Vinh", "VN-48", "Province"), + ("Tuyên Quang", "VN-07", "Province"), + ("Vĩnh Long", "VN-45", "Province"), + ("Vĩnh Phúc", "VN-58", "Province"), + ("Yên Bái", "VN-06", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVietnam() + { + 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/VirginIslandsBritishTest.cs b/src/World.Net.UnitTests/Countries/VirginIslandsBritishTest.cs new file mode 100644 index 0000000..6cff61e --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VirginIslandsBritishTest.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VirginIslandsBritishTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Virgin Islands (British)"; + private const string NATIVE_NAME = "British Virgin Islands"; + private const string CAPITAL = "Road Town"; + private const string OFFICIAL_NAME = "British Virgin Islands"; + private const string ISO2_CODE = "VG"; + private const string ISO3_CODE = "VGB"; + private const int NUMERIC_CODE = 92; + private readonly string[] CALLING_CODE = ["+1-284"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.VirginIslandsBritish; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVirginIslandsBritish() + { + 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/VirginIslandsUSTest.cs b/src/World.Net.UnitTests/Countries/VirginIslandsUSTest.cs new file mode 100644 index 0000000..26960c6 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/VirginIslandsUSTest.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class VirginIslandsUSTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Virgin Islands (US)"; + private const string NATIVE_NAME = "United States Virgin Islands"; + private const string CAPITAL = "Charlotte Amalie"; + private const string OFFICIAL_NAME = "United States Virgin Islands"; + private const string ISO2_CODE = "VI"; + private const string ISO3_CODE = "VIR"; + private const int NUMERIC_CODE = 850; + private readonly string[] CALLING_CODE = ["+1-340"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.VirginIslandsUS; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForVirginIslandsUS() + { + 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/WallisAndFutunaTest.cs b/src/World.Net.UnitTests/Countries/WallisAndFutunaTest.cs new file mode 100644 index 0000000..19cdfcf --- /dev/null +++ b/src/World.Net.UnitTests/Countries/WallisAndFutunaTest.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class WallisAndFutunaTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Wallis and Futuna"; + private const string NATIVE_NAME = "Wallis et Futuna"; + private const string CAPITAL = "Mata-Utu"; + private const string OFFICIAL_NAME = "Territory of the Wallis and Futuna Islands"; + private const string ISO2_CODE = "WF"; + private const string ISO3_CODE = "WLF"; + private const int NUMERIC_CODE = 876; + private readonly string[] CALLING_CODE = ["+681"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.WallisAndFutunaIslands; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Alo", "WF-AL", "District"), + ("Sigave", "WF-SG", "District"), + ("Uvea", "WF-UV", "District") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForWallisAndFutuna() + { + 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/WesternSaharaTest.cs b/src/World.Net.UnitTests/Countries/WesternSaharaTest.cs new file mode 100644 index 0000000..c8f8078 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/WesternSaharaTest.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class WesternSaharaTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Western Sahara"; + private const string NATIVE_NAME = "الصحراء الغربية"; + private const string CAPITAL = "El Aaiún"; + private const string OFFICIAL_NAME = "Sahrawi Arab Democratic Republic"; + private const string ISO2_CODE = "EH"; + private const string ISO3_CODE = "ESH"; + private const int NUMERIC_CODE = 732; + private readonly string[] CALLING_CODE = ["+212"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.WesternSahara; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>(); + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForWesternSahara() + { + 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/YemenTest.cs b/src/World.Net.UnitTests/Countries/YemenTest.cs new file mode 100644 index 0000000..bbfd18b --- /dev/null +++ b/src/World.Net.UnitTests/Countries/YemenTest.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class YemenTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Yemen"; + private const string NATIVE_NAME = "الجمهورية اليمنية"; + private const string CAPITAL = "Sana’a"; + private const string OFFICIAL_NAME = "Republic of Yemen"; + private const string ISO2_CODE = "YE"; + private const string ISO3_CODE = "YEM"; + private const int NUMERIC_CODE = 887; + private readonly string[] CALLING_CODE = ["+967"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Yemen; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Abyan", "YE-AB", "Governorate"), + ("Aden", "YE-AD", "Governorate"), + ("Al Bayda", "YE-BD", "Governorate"), + ("Al Hudaydah", "YE-HD", "Governorate"), + ("Al Jawf", "YE-JW", "Governorate"), + ("Al Mahrah", "YE-MR", "Governorate"), + ("Al Mahwit", "YE-MW", "Governorate"), + ("Amran", "YE-AM", "Governorate"), + ("Dhamar", "YE-DH", "Governorate"), + ("Hadhramaut", "YE-HU", "Governorate"), + ("Hajjah", "YE-HJ", "Governorate"), + ("Ibb", "YE-IB", "Governorate"), + ("Lahij", "YE-LH", "Governorate"), + ("Ma’rib", "YE-MA", "Governorate"), + ("Raymah", "YE-RH", "Governorate"), + ("Sa’dah", "YE-SD", "Governorate"), + ("Sana’a", "YE-SN", "Governorate"), + ("Shabwah", "YE-SH", "Governorate"), + ("Socotra", "YE-SS", "Governorate"), + ("Ta’izz", "YE-TA", "Governorate") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForYemen() + { + 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/ZambiaTest.cs b/src/World.Net.UnitTests/Countries/ZambiaTest.cs new file mode 100644 index 0000000..68eea0c --- /dev/null +++ b/src/World.Net.UnitTests/Countries/ZambiaTest.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class ZambiaTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Zambia"; + private const string NATIVE_NAME = "Republic of Zambia"; + private const string CAPITAL = "Lusaka"; + private const string OFFICIAL_NAME = "Republic of Zambia"; + private const string ISO2_CODE = "ZM"; + private const string ISO3_CODE = "ZMB"; + private const int NUMERIC_CODE = 894; + private readonly string[] CALLING_CODE = ["+260"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Zambia; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Central", "ZM-02", "Province"), + ("Copperbelt", "ZM-08", "Province"), + ("Eastern", "ZM-03", "Province"), + ("Luapula", "ZM-04", "Province"), + ("Lusaka", "ZM-09", "Province"), + ("Muchinga", "ZM-13", "Province"), + ("Northern", "ZM-05", "Province"), + ("North-Western", "ZM-06", "Province"), + ("Southern", "ZM-07", "Province"), + ("Western", "ZM-01", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForZambia() + { + 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/ZimbabweTest.cs b/src/World.Net.UnitTests/Countries/ZimbabweTest.cs new file mode 100644 index 0000000..5fad5a0 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/ZimbabweTest.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace World.Net.UnitTests.Countries +{ + public sealed class ZimbabweTest : AssertCountryTestBase + { + private const string COUNTRY_NAME = "Zimbabwe"; + private const string NATIVE_NAME = "Republic of Zimbabwe"; + private const string CAPITAL = "Harare"; + private const string OFFICIAL_NAME = "Republic of Zimbabwe"; + private const string ISO2_CODE = "ZW"; + private const string ISO3_CODE = "ZWE"; + private const int NUMERIC_CODE = 716; + private readonly string[] CALLING_CODE = ["+263"]; + private const CountryIdentifier EXPECTEDID = CountryIdentifier.Zimbabwe; + + private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = + { + ("Bulawayo", "ZW-BU", "Province"), + ("Harare", "ZW-HA", "Province"), + ("Manicaland", "ZW-MA", "Province"), + ("Mashonaland Central", "ZW-MC", "Province"), + ("Mashonaland East", "ZW-ME", "Province"), + ("Mashonaland West", "ZW-MW", "Province"), + ("Masvingo", "ZW-MV", "Province"), + ("Matabeleland North", "ZW-MN", "Province"), + ("Matabeleland South", "ZW-MS", "Province"), + ("Midlands", "ZW-MI", "Province") + }; + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForZimbabwe() + { + 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/Uganda.cs b/src/World.Net/Countries/Uganda.cs new file mode 100644 index 0000000..f74020f --- /dev/null +++ b/src/World.Net/Countries/Uganda.cs @@ -0,0 +1,31 @@ +namespace World.Net.Countries; + +internal sealed class Uganda : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Uganda; + + public string Name { get; } = "Uganda"; + + public string OfficialName { get; } = "Republic of Uganda"; + + public string NativeName => "Uganda"; + + public string Capital { get; } = "Kampala"; + + public int NumericCode { get; } = 800; + + public string ISO2Code { get; } = "UG"; + + public string ISO3Code { get; } = "UGA"; + + public string[] CallingCode { get; } = ["+256"]; + + public IEnumerable States => new[] + { + new State("Central", "UG-C", "Region"), + new State("Eastern", "UG-E", "Region"), + new State("Northern", "UG-N", "Region"), + new State("Western", "UG-W", "Region") + }; +} + diff --git a/src/World.Net/Countries/Ukraine.cs b/src/World.Net/Countries/Ukraine.cs new file mode 100644 index 0000000..d487a95 --- /dev/null +++ b/src/World.Net/Countries/Ukraine.cs @@ -0,0 +1,54 @@ +namespace World.Net.Countries; + +internal sealed class Ukraine : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Ukraine; + + public string Name { get; } = "Ukraine"; + + public string OfficialName { get; } = "Ukraine"; + + public string NativeName => "Україна"; + + public string Capital { get; } = "Kyiv"; + + public int NumericCode { get; } = 804; + + public string ISO2Code { get; } = "UA"; + + public string ISO3Code { get; } = "UKR"; + + public string[] CallingCode { get; } = ["+380"]; + + public IEnumerable States => new[] + { + new State("Cherkasy", "UA-CK", "Oblast"), + new State("Chernihiv", "UA-CH", "Oblast"), + new State("Chernivtsi", "UA-CV", "Oblast"), + new State("Dnipropetrovsk", "UA-DP", "Oblast"), + new State("Donetsk", "UA-DO", "Oblast"), + new State("Ivano-Frankivsk", "UA-IF", "Oblast"), + new State("Kharkiv", "UA-KH", "Oblast"), + new State("Kherson", "UA-KH", "Oblast"), + new State("Khmelnytskyi", "UA-KM", "Oblast"), + new State("Kirovohrad", "UA-KR", "Oblast"), + new State("Kyiv", "UA-KY", "City"), + new State("Kyiv Oblast", "UA-KY", "Oblast"), + new State("Luhansk", "UA-LU", "Oblast"), + new State("Lviv", "UA-LV", "Oblast"), + new State("Mykolaiv", "UA-MK", "Oblast"), + new State("Odessa", "UA-OD", "Oblast"), + new State("Poltava", "UA-PL", "Oblast"), + new State("Rivne", "UA-RV", "Oblast"), + new State("Sevastopol", "UA-SE", "City"), + new State("Sumy", "UA-SU", "Oblast"), + new State("Ternopil", "UA-TE", "Oblast"), + new State("Vinnytsia", "UA-VI", "Oblast"), + new State("Volyn", "UA-VO", "Oblast"), + new State("Zakarpattia", "UA-ZA", "Oblast"), + new State("Zaporizhzhia", "UA-ZP", "Oblast"), + new State("Zhytomyr", "UA-ZH", "Oblast"), + new State("Autonomous Republic of Crimea", "UA-CR", "Autonomous Republic") + }; +} + diff --git a/src/World.Net/Countries/UnitedArabEmirates.cs b/src/World.Net/Countries/UnitedArabEmirates.cs new file mode 100644 index 0000000..6d1a018 --- /dev/null +++ b/src/World.Net/Countries/UnitedArabEmirates.cs @@ -0,0 +1,34 @@ +namespace World.Net.Countries; + +internal sealed class UnitedArabEmirates : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.UnitedArabEmirates; + + public string Name { get; } = "United Arab Emirates"; + + public string OfficialName { get; } = "United Arab Emirates"; + + public string NativeName => "الإمارات العربية المتحدة"; + + public string Capital { get; } = "Abu Dhabi"; + + public int NumericCode { get; } = 784; + + public string ISO2Code { get; } = "AE"; + + public string ISO3Code { get; } = "ARE"; + + public string[] CallingCode { get; } = ["+971"]; + + public IEnumerable States => new[] + { + new State("Abu Dhabi", "AE-AZ", "Emirate"), + new State("Ajman", "AE-AJ", "Emirate"), + new State("Dubai", "AE-DU", "Emirate"), + new State("Fujairah", "AE-FU", "Emirate"), + new State("Ras Al Khaimah", "AE-RK", "Emirate"), + new State("Sharjah", "AE-SH", "Emirate"), + new State("Umm Al Quwain", "AE-UQ", "Emirate") + }; +} + diff --git a/src/World.Net/Countries/UnitedKingdom.cs b/src/World.Net/Countries/UnitedKingdom.cs new file mode 100644 index 0000000..7c0c7d4 --- /dev/null +++ b/src/World.Net/Countries/UnitedKingdom.cs @@ -0,0 +1,31 @@ +namespace World.Net.Countries; + +internal sealed class UnitedKingdom : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.UnitedKingdom; + + public string Name { get; } = "United Kingdom"; + + public string OfficialName { get; } = "United Kingdom of Great Britain and Northern Ireland"; + + public string NativeName => "United Kingdom"; + + public string Capital { get; } = "London"; + + public int NumericCode { get; } = 826; + + public string ISO2Code { get; } = "GB"; + + public string ISO3Code { get; } = "GBR"; + + public string[] CallingCode { get; } = ["+44"]; + + public IEnumerable States => new[] + { + new State("England", "GB-ENG", "Country"), + new State("Scotland", "GB-SCT", "Country"), + new State("Wales", "GB-WLS", "Country"), + new State("Northern Ireland", "GB-NIR", "Country") + }; +} + diff --git a/src/World.Net/Countries/UnitedStates.cs b/src/World.Net/Countries/UnitedStates.cs new file mode 100644 index 0000000..1eec24d --- /dev/null +++ b/src/World.Net/Countries/UnitedStates.cs @@ -0,0 +1,78 @@ +namespace World.Net.Countries; + +internal sealed class UnitedStates : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.UnitedStates; + + public string Name { get; } = "United States"; + + public string OfficialName { get; } = "United States of America"; + + public string NativeName => "United States"; + + public string Capital { get; } = "Washington, D.C."; + + public int NumericCode { get; } = 840; + + public string ISO2Code { get; } = "US"; + + public string ISO3Code { get; } = "USA"; + + public string[] CallingCode { get; } = ["+1"]; + + public IEnumerable States => new[] + { + new State("Alabama", "US-AL", "State"), + new State("Alaska", "US-AK", "State"), + new State("Arizona", "US-AZ", "State"), + new State("Arkansas", "US-AR", "State"), + new State("California", "US-CA", "State"), + new State("Colorado", "US-CO", "State"), + new State("Connecticut", "US-CT", "State"), + new State("Delaware", "US-DE", "State"), + new State("Florida", "US-FL", "State"), + new State("Georgia", "US-GA", "State"), + new State("Hawaii", "US-HI", "State"), + new State("Idaho", "US-ID", "State"), + new State("Illinois", "US-IL", "State"), + new State("Indiana", "US-IN", "State"), + new State("Iowa", "US-IA", "State"), + new State("Kansas", "US-KS", "State"), + new State("Kentucky", "US-KY", "State"), + new State("Louisiana", "US-LA", "State"), + new State("Maine", "US-ME", "State"), + new State("Maryland", "US-MD", "State"), + new State("Massachusetts", "US-MA", "State"), + new State("Michigan", "US-MI", "State"), + new State("Minnesota", "US-MN", "State"), + new State("Mississippi", "US-MS", "State"), + new State("Missouri", "US-MO", "State"), + new State("Montana", "US-MT", "State"), + new State("Nebraska", "US-NE", "State"), + new State("Nevada", "US-NV", "State"), + new State("New Hampshire", "US-NH", "State"), + new State("New Jersey", "US-NJ", "State"), + new State("New Mexico", "US-NM", "State"), + new State("New York", "US-NY", "State"), + new State("North Carolina", "US-NC", "State"), + new State("North Dakota", "US-ND", "State"), + new State("Ohio", "US-OH", "State"), + new State("Oklahoma", "US-OK", "State"), + new State("Oregon", "US-OR", "State"), + new State("Pennsylvania", "US-PA", "State"), + new State("Rhode Island", "US-RI", "State"), + new State("South Carolina", "US-SC", "State"), + new State("South Dakota", "US-SD", "State"), + new State("Tennessee", "US-TN", "State"), + new State("Texas", "US-TX", "State"), + new State("Utah", "US-UT", "State"), + new State("Vermont", "US-VT", "State"), + new State("Virginia", "US-VA", "State"), + new State("Washington", "US-WA", "State"), + new State("West Virginia", "US-WV", "State"), + new State("Wisconsin", "US-WI", "State"), + new State("Wyoming", "US-WY", "State"), + new State("District of Columbia", "US-DC", "Federal District") + }; +} + diff --git a/src/World.Net/Countries/UnitedStatesMinorOutlyingIslands.cs b/src/World.Net/Countries/UnitedStatesMinorOutlyingIslands.cs new file mode 100644 index 0000000..07c383d --- /dev/null +++ b/src/World.Net/Countries/UnitedStatesMinorOutlyingIslands.cs @@ -0,0 +1,24 @@ +namespace World.Net.Countries; + +internal sealed class UnitedStatesMinorOutlyingIslands : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.UnitedStatesMinorOutlyingIslands; + + public string Name { get; } = "United States Minor Outlying Islands"; + + public string OfficialName { get; } = "United States Minor Outlying Islands"; + + public string NativeName => "United States Minor Outlying Islands"; + + public string Capital { get; } = null; + + public int NumericCode { get; } = 581; + + public string ISO2Code { get; } = "UM"; + + public string ISO3Code { get; } = "UMI"; + + public string[] CallingCode { get; } = ["+1"]; + + public IEnumerable States => Array.Empty(); +} diff --git a/src/World.Net/Countries/Uruguay.cs b/src/World.Net/Countries/Uruguay.cs new file mode 100644 index 0000000..25ecec3 --- /dev/null +++ b/src/World.Net/Countries/Uruguay.cs @@ -0,0 +1,46 @@ +namespace World.Net.Countries; + +internal sealed class Uruguay : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Uruguay; + + public string Name { get; } = "Uruguay"; + + public string OfficialName { get; } = "Oriental Republic of Uruguay"; + + public string NativeName => "República Oriental del Uruguay"; + + public string Capital { get; } = "Montevideo"; + + public int NumericCode { get; } = 858; + + public string ISO2Code { get; } = "UY"; + + public string ISO3Code { get; } = "URY"; + + public string[] CallingCode { get; } = ["+598"]; + + public IEnumerable States => new[] + { + new State("Artigas", "UY-AR", "Department"), + new State("Canelones", "UY-CA", "Department"), + new State("Cerro Largo", "UY-CL", "Department"), + new State("Colonia", "UY-CO", "Department"), + new State("Durazno", "UY-DU", "Department"), + new State("Flores", "UY-FS", "Department"), + new State("Florida", "UY-FD", "Department"), + new State("Lavalleja", "UY-LA", "Department"), + new State("Maldonado", "UY-MA", "Department"), + new State("Montevideo", "UY-MO", "Department"), + new State("Paysandú", "UY-PA", "Department"), + new State("Río Negro", "UY-RN", "Department"), + new State("Rivera", "UY-RV", "Department"), + new State("Rocha", "UY-RO", "Department"), + new State("Salto", "UY-SA", "Department"), + new State("San José", "UY-SJ", "Department"), + new State("Soriano", "UY-SO", "Department"), + new State("Tacuarembó", "UY-TA", "Department"), + new State("Treinta y Tres", "UY-TT", "Department") + }; +} + diff --git a/src/World.Net/Countries/Uzbekistan.cs b/src/World.Net/Countries/Uzbekistan.cs new file mode 100644 index 0000000..8e375c4 --- /dev/null +++ b/src/World.Net/Countries/Uzbekistan.cs @@ -0,0 +1,41 @@ +namespace World.Net.Countries; + +internal sealed class Uzbekistan : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Uzbekistan; + + public string Name { get; } = "Uzbekistan"; + + public string OfficialName { get; } = "Republic of Uzbekistan"; + + public string NativeName => "Oʻzbekiston Respublikasi"; + + public string Capital { get; } = "Tashkent"; + + public int NumericCode { get; } = 860; + + public string ISO2Code { get; } = "UZ"; + + public string ISO3Code { get; } = "UZB"; + + public string[] CallingCode { get; } = ["+998"]; + + public IEnumerable States => new[] + { + new State("Andijan", "UZ-AN", "Region"), + new State("Bukhara", "UZ-BU", "Region"), + new State("Fergana", "UZ-FA", "Region"), + new State("Jizzakh", "UZ-JI", "Region"), + new State("Kashkadarya", "UZ-KA", "Region"), + new State("Khorezm", "UZ-KH", "Region"), + new State("Namangan", "UZ-NG", "Region"), + new State("Navoiy", "UZ-NW", "Region"), + new State("Samarkand", "UZ-SA", "Region"), + new State("Sirdaryo", "UZ-SI", "Region"), + new State("Surxondaryo", "UZ-SU", "Region"), + new State("Tashkent Region", "UZ-TO", "Region"), + new State("Republic of Karakalpakstan", "UZ-QA", "Autonomous Republic"), + new State("Tashkent", "UZ-TK", "City") + }; +} + diff --git a/src/World.Net/Countries/Vanuatu.cs b/src/World.Net/Countries/Vanuatu.cs new file mode 100644 index 0000000..5745d61 --- /dev/null +++ b/src/World.Net/Countries/Vanuatu.cs @@ -0,0 +1,33 @@ +namespace World.Net.Countries; + +internal sealed class Vanuatu : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Vanuatu; + + public string Name { get; } = "Vanuatu"; + + public string OfficialName { get; } = "Republic of Vanuatu"; + + public string NativeName => "Ripablik blong Vanuatu"; + + public string Capital { get; } = "Port Vila"; + + public int NumericCode { get; } = 548; + + public string ISO2Code { get; } = "VU"; + + public string ISO3Code { get; } = "VUT"; + + public string[] CallingCode { get; } = ["+678"]; + + public IEnumerable States => new[] + { + new State("Malampa", "VU-MAP", "Province"), + new State("Penama", "VU-PAM", "Province"), + new State("Sanma", "VU-SAM", "Province"), + new State("Shefa", "VU-SEE", "Province"), + new State("Tafea", "VU-TAE", "Province"), + new State("Torba", "VU-TOB", "Province") + }; +} + diff --git a/src/World.Net/Countries/VaticanCity.cs b/src/World.Net/Countries/VaticanCity.cs new file mode 100644 index 0000000..9e5b133 --- /dev/null +++ b/src/World.Net/Countries/VaticanCity.cs @@ -0,0 +1,25 @@ +namespace World.Net.Countries; + +internal sealed class VaticanCity : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.VaticanCityState; + + public string Name { get; } = "Vatican City State (Holy See)"; + + public string OfficialName { get; } = "Vatican City State"; + + public string NativeName => "Stato della Città del Vaticano"; + + public string Capital { get; } = "Vatican City"; + + public int NumericCode { get; } = 336; + + public string ISO2Code { get; } = "VA"; + + public string ISO3Code { get; } = "VAT"; + + public string[] CallingCode { get; } = ["+379"]; + + public IEnumerable States => Array.Empty(); +} + diff --git a/src/World.Net/Countries/Venezuela.cs b/src/World.Net/Countries/Venezuela.cs new file mode 100644 index 0000000..04d2165 --- /dev/null +++ b/src/World.Net/Countries/Venezuela.cs @@ -0,0 +1,50 @@ +namespace World.Net.Countries; + +internal sealed class Venezuela : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Venezuela; + + public string Name { get; } = "Venezuela"; + + public string OfficialName { get; } = "Bolivarian Republic of Venezuela"; + + public string NativeName => "República Bolivariana de Venezuela"; + + public string Capital { get; } = "Caracas"; + + public int NumericCode { get; } = 862; + + public string ISO2Code { get; } = "VE"; + + public string ISO3Code { get; } = "VEN"; + + public string[] CallingCode { get; } = ["+58"]; + + public IEnumerable States => new[] + { + new State("Amazonas", "VE-Z", "State"), + new State("Anzoátegui", "VE-B", "State"), + new State("Apure", "VE-C", "State"), + new State("Aragua", "VE-D", "State"), + new State("Barinas", "VE-E", "State"), + new State("Bolívar", "VE-F", "State"), + new State("Carabobo", "VE-G", "State"), + new State("Cojedes", "VE-H", "State"), + new State("Delta Amacuro", "VE-Y", "State"), + new State("Falcón", "VE-I", "State"), + new State("Guárico", "VE-J", "State"), + new State("Lara", "VE-K", "State"), + new State("Mérida", "VE-L", "State"), + new State("Miranda", "VE-M", "State"), + new State("Monagas", "VE-N", "State"), + new State("Nueva Esparta", "VE-O", "State"), + new State("Portuguesa", "VE-P", "State"), + new State("Sucre", "VE-R", "State"), + new State("Táchira", "VE-S", "State"), + new State("Trujillo", "VE-T", "State"), + new State("Vargas", "VE-X", "State"), + new State("Yaracuy", "VE-U", "State"), + new State("Zulia", "VE-V", "State"), + new State("Capital District", "VE-DC", "Capital District") + }; +} diff --git a/src/World.Net/Countries/Vietnam.cs b/src/World.Net/Countries/Vietnam.cs new file mode 100644 index 0000000..7530ce1 --- /dev/null +++ b/src/World.Net/Countries/Vietnam.cs @@ -0,0 +1,90 @@ +namespace World.Net.Countries; + +internal sealed class Vietnam : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Vietnam; + + public string Name { get; } = "Vietnam"; + + public string OfficialName { get; } = "Socialist Republic of Vietnam"; + + public string NativeName => "Cộng hòa Xã hội Chủ nghĩa Việt Nam"; + + public string Capital { get; } = "Hanoi"; + + public int NumericCode { get; } = 704; + + public string ISO2Code { get; } = "VN"; + + public string ISO3Code { get; } = "VNM"; + + public string[] CallingCode { get; } = ["+84"]; + + public IEnumerable States => new[] + { + new State("An Giang", "VN-44", "Province"), + new State("Bà Rịa–Vũng Tàu", "VN-43", "Province"), + new State("Bắc Giang", "VN-54", "Province"), + new State("Bắc Kạn", "VN-53", "Province"), + new State("Bạc Liêu", "VN-50", "Province"), + new State("Bắc Ninh", "VN-56", "Province"), + new State("Bến Tre", "VN-51", "Province"), + new State("Bình Định", "VN-31", "Province"), + new State("Bình Dương", "VN-74", "Province"), + new State("Bình Phước", "VN-70", "Province"), + new State("Bình Thuận", "VN-40", "Province"), + new State("Cà Mau", "VN-49", "Province"), + new State("Cần Thơ", "VN-CT", "Municipality"), + new State("Cao Bằng", "VN-04", "Province"), + new State("Đà Nẵng", "VN-DN", "Municipality"), + new State("Đắk Lắk", "VN-33", "Province"), + new State("Đắk Nông", "VN-72", "Province"), + new State("Điện Biên", "VN-11", "Province"), + new State("Đồng Nai", "VN-75", "Province"), + new State("Đồng Tháp", "VN-67", "Province"), + new State("Gia Lai", "VN-30", "Province"), + new State("Hà Giang", "VN-02", "Province"), + new State("Hà Nam", "VN-63", "Province"), + new State("Hà Nội", "VN-HN", "Municipality"), + new State("Hà Tĩnh", "VN-24", "Province"), + new State("Hải Dương", "VN-61", "Province"), + new State("Hải Phòng", "VN-HP", "Municipality"), + new State("Hậu Giang", "VN-64", "Province"), + new State("Hòa Bình", "VN-14", "Province"), + new State("Hưng Yên", "VN-66", "Province"), + new State("Khánh Hòa", "VN-34", "Province"), + new State("Kiên Giang", "VN-47", "Province"), + new State("Kon Tum", "VN-28", "Province"), + new State("Lai Châu", "VN-12", "Province"), + new State("Lâm Đồng", "VN-35", "Province"), + new State("Lạng Sơn", "VN-20", "Province"), + new State("Lào Cai", "VN-10", "Province"), + new State("Long An", "VN-41", "Province"), + new State("Nam Định", "VN-67", "Province"), + new State("Nghệ An", "VN-28", "Province"), + new State("Ninh Bình", "VN-18", "Province"), + new State("Ninh Thuận", "VN-36", "Province"), + new State("Phú Thọ", "VN-68", "Province"), + new State("Phú Yên", "VN-32", "Province"), + new State("Quảng Bình", "VN-23", "Province"), + new State("Quảng Nam", "VN-27", "Province"), + new State("Quảng Ngãi", "VN-29", "Province"), + new State("Quảng Ninh", "VN-22", "Province"), + new State("Quảng Trị", "VN-25", "Province"), + new State("Sóc Trăng", "VN-52", "Province"), + new State("Sơn La", "VN-15", "Province"), + new State("Tây Ninh", "VN-37", "Province"), + new State("Thái Bình", "VN-60", "Province"), + new State("Thái Nguyên", "VN-19", "Province"), + new State("Thanh Hóa", "VN-21", "Province"), + new State("Thừa Thiên–Huế", "VN-26", "Province"), + new State("Tiền Giang", "VN-42", "Province"), + new State("TP Hồ Chí Minh", "VN-HCM", "Municipality"), + new State("Trà Vinh", "VN-48", "Province"), + new State("Tuyên Quang", "VN-07", "Province"), + new State("Vĩnh Long", "VN-45", "Province"), + new State("Vĩnh Phúc", "VN-58", "Province"), + new State("Yên Bái", "VN-06", "Province") + }; +} + diff --git a/src/World.Net/Countries/VirginIslandsBritish.cs b/src/World.Net/Countries/VirginIslandsBritish.cs new file mode 100644 index 0000000..05140ca --- /dev/null +++ b/src/World.Net/Countries/VirginIslandsBritish.cs @@ -0,0 +1,24 @@ +namespace World.Net.Countries; + +internal sealed class VirginIslandsBritish : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.VirginIslandsBritish; + + public string Name { get; } = "Virgin Islands (British)"; + + public string OfficialName { get; } = "British Virgin Islands"; + + public string NativeName => "British Virgin Islands"; + + public string Capital { get; } = "Road Town"; + + public int NumericCode { get; } = 92; + + public string ISO2Code { get; } = "VG"; + + public string ISO3Code { get; } = "VGB"; + + public string[] CallingCode { get; } = ["+1-284"]; + + public IEnumerable States => Array.Empty(); +} diff --git a/src/World.Net/Countries/VirginIslandsUS.cs b/src/World.Net/Countries/VirginIslandsUS.cs new file mode 100644 index 0000000..480f6a9 --- /dev/null +++ b/src/World.Net/Countries/VirginIslandsUS.cs @@ -0,0 +1,25 @@ +namespace World.Net.Countries; + +internal sealed class VirginIslandsUS : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.VirginIslandsUS; + + public string Name { get; } = "Virgin Islands (US)"; + + public string OfficialName { get; } = "United States Virgin Islands"; + + public string NativeName => "United States Virgin Islands"; + + public string Capital { get; } = "Charlotte Amalie"; + + public int NumericCode { get; } = 850; + + public string ISO2Code { get; } = "VI"; + + public string ISO3Code { get; } = "VIR"; + + public string[] CallingCode { get; } = ["+1-340"]; + + public IEnumerable States => Array.Empty(); +} + diff --git a/src/World.Net/Countries/WallisAndFutuna.cs b/src/World.Net/Countries/WallisAndFutuna.cs new file mode 100644 index 0000000..c1b9dfa --- /dev/null +++ b/src/World.Net/Countries/WallisAndFutuna.cs @@ -0,0 +1,30 @@ +namespace World.Net.Countries; + +internal sealed class WallisAndFutuna : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.WallisAndFutunaIslands; + + public string Name { get; } = "Wallis and Futuna"; + + public string OfficialName { get; } = "Territory of the Wallis and Futuna Islands"; + + public string NativeName => "Wallis et Futuna"; + + public string Capital { get; } = "Mata-Utu"; + + public int NumericCode { get; } = 876; + + public string ISO2Code { get; } = "WF"; + + public string ISO3Code { get; } = "WLF"; + + public string[] CallingCode { get; } = ["+681"]; + + public IEnumerable States => new[] + { + new State("Alo", "WF-AL", "District"), + new State("Sigave", "WF-SG", "District"), + new State("Uvea", "WF-UV", "District") + }; +} + diff --git a/src/World.Net/Countries/WesternSahara.cs b/src/World.Net/Countries/WesternSahara.cs new file mode 100644 index 0000000..0addf42 --- /dev/null +++ b/src/World.Net/Countries/WesternSahara.cs @@ -0,0 +1,25 @@ +namespace World.Net.Countries; + +internal sealed class WesternSahara : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.WesternSahara; + + public string Name { get; } = "Western Sahara"; + + public string OfficialName { get; } = "Sahrawi Arab Democratic Republic"; + + public string NativeName => "الصحراء الغربية"; + + public string Capital { get; } = "El Aaiún"; + + public int NumericCode { get; } = 732; + + public string ISO2Code { get; } = "EH"; + + public string ISO3Code { get; } = "ESH"; + + public string[] CallingCode { get; } = ["+212"]; + + public IEnumerable States => Array.Empty(); +} + diff --git a/src/World.Net/Countries/Yemen.cs b/src/World.Net/Countries/Yemen.cs new file mode 100644 index 0000000..cc453f5 --- /dev/null +++ b/src/World.Net/Countries/Yemen.cs @@ -0,0 +1,47 @@ +namespace World.Net.Countries; + +internal sealed class Yemen : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Yemen; + + public string Name { get; } = "Yemen"; + + public string OfficialName { get; } = "Republic of Yemen"; + + public string NativeName => "الجمهورية اليمنية"; + + public string Capital { get; } = "Sana’a"; + + public int NumericCode { get; } = 887; + + public string ISO2Code { get; } = "YE"; + + public string ISO3Code { get; } = "YEM"; + + public string[] CallingCode { get; } = ["+967"]; + + public IEnumerable States => new[] + { + new State("Abyan", "YE-AB", "Governorate"), + new State("Aden", "YE-AD", "Governorate"), + new State("Al Bayda", "YE-BD", "Governorate"), + new State("Al Hudaydah", "YE-HD", "Governorate"), + new State("Al Jawf", "YE-JW", "Governorate"), + new State("Al Mahrah", "YE-MR", "Governorate"), + new State("Al Mahwit", "YE-MW", "Governorate"), + new State("Amran", "YE-AM", "Governorate"), + new State("Dhamar", "YE-DH", "Governorate"), + new State("Hadhramaut", "YE-HU", "Governorate"), + new State("Hajjah", "YE-HJ", "Governorate"), + new State("Ibb", "YE-IB", "Governorate"), + new State("Lahij", "YE-LH", "Governorate"), + new State("Ma’rib", "YE-MA", "Governorate"), + new State("Raymah", "YE-RH", "Governorate"), + new State("Sa’dah", "YE-SD", "Governorate"), + new State("Sana’a", "YE-SN", "Governorate"), + new State("Shabwah", "YE-SH", "Governorate"), + new State("Socotra", "YE-SS", "Governorate"), + new State("Ta’izz", "YE-TA", "Governorate") + }; +} + diff --git a/src/World.Net/Countries/Zambia.cs b/src/World.Net/Countries/Zambia.cs new file mode 100644 index 0000000..f1d36ae --- /dev/null +++ b/src/World.Net/Countries/Zambia.cs @@ -0,0 +1,36 @@ +namespace World.Net.Countries; + +internal sealed class Zambia : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Zambia; + + public string Name { get; } = "Zambia"; + + public string OfficialName { get; } = "Republic of Zambia"; + + public string NativeName => "Republic of Zambia"; + + public string Capital { get; } = "Lusaka"; + + public int NumericCode { get; } = 894; + + public string ISO2Code { get; } = "ZM"; + + public string ISO3Code { get; } = "ZMB"; + + public string[] CallingCode { get; } = ["+260"]; + + public IEnumerable States => new[] + { + new State("Central", "ZM-02", "Province"), + new State("Copperbelt", "ZM-08", "Province"), + new State("Eastern", "ZM-03", "Province"), + new State("Luapula", "ZM-04", "Province"), + new State("Lusaka", "ZM-09", "Province"), + new State("Muchinga", "ZM-13", "Province"), + new State("Northern", "ZM-05", "Province"), + new State("North-Western", "ZM-06", "Province"), + new State("Southern", "ZM-07", "Province"), + new State("Western", "ZM-01", "Province") + }; +} diff --git a/src/World.Net/Countries/Zimbabwe.cs b/src/World.Net/Countries/Zimbabwe.cs new file mode 100644 index 0000000..6536edc --- /dev/null +++ b/src/World.Net/Countries/Zimbabwe.cs @@ -0,0 +1,37 @@ +namespace World.Net.Countries; + +internal sealed class Zimbabwe : ICountry +{ + public CountryIdentifier Id => CountryIdentifier.Zimbabwe; + + public string Name { get; } = "Zimbabwe"; + + public string OfficialName { get; } = "Republic of Zimbabwe"; + + public string NativeName => "Republic of Zimbabwe"; + + public string Capital { get; } = "Harare"; + + public int NumericCode { get; } = 716; + + public string ISO2Code { get; } = "ZW"; + + public string ISO3Code { get; } = "ZWE"; + + public string[] CallingCode { get; } = ["+263"]; + + public IEnumerable States => new[] + { + new State("Bulawayo", "ZW-BU", "Province"), + new State("Harare", "ZW-HA", "Province"), + new State("Manicaland", "ZW-MA", "Province"), + new State("Mashonaland Central", "ZW-MC", "Province"), + new State("Mashonaland East", "ZW-ME", "Province"), + new State("Mashonaland West", "ZW-MW", "Province"), + new State("Masvingo", "ZW-MV", "Province"), + new State("Matabeleland North", "ZW-MN", "Province"), + new State("Matabeleland South", "ZW-MS", "Province"), + new State("Midlands", "ZW-MI", "Province") + }; +} + diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index 534157b..99434f3 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -207,6 +207,25 @@ public static Dictionary Initialize() { CountryIdentifier.Turkmenistan, new Turkmenistan() }, { CountryIdentifier.TurksAndCaicosIslands, new TurksAndCaicosIslands() }, { CountryIdentifier.Tuvalu, new Tuvalu() }, + { CountryIdentifier.Uganda, new Uganda() }, + { CountryIdentifier.Ukraine, new Ukraine() }, + { CountryIdentifier.UnitedArabEmirates, new UnitedArabEmirates() }, + { CountryIdentifier.UnitedKingdom, new UnitedKingdom() }, + { CountryIdentifier.UnitedStates, new UnitedStates() }, + { CountryIdentifier.UnitedStatesMinorOutlyingIslands, new UnitedStatesMinorOutlyingIslands() }, + { CountryIdentifier.Uruguay, new Uruguay() }, + { CountryIdentifier.Uzbekistan, new Uzbekistan() }, + { CountryIdentifier.Vanuatu, new Vanuatu() }, + { CountryIdentifier.VaticanCityState, new VaticanCity() }, + { CountryIdentifier.Venezuela, new Venezuela() }, + { CountryIdentifier.Vietnam, new Vietnam() }, + { CountryIdentifier.VirginIslandsBritish, new VirginIslandsBritish() }, + { CountryIdentifier.VirginIslandsUS, new VirginIslandsUS() }, + { CountryIdentifier.WallisAndFutunaIslands, new WallisAndFutuna() }, + { CountryIdentifier.WesternSahara, new WesternSahara() }, + { CountryIdentifier.Yemen, new Yemen() }, + { CountryIdentifier.Zambia, new Zambia() }, + { CountryIdentifier.Zimbabwe, new Zimbabwe() }, // Future countries can be added here in the same format. };