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..534157b 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,20 @@ 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.Thailand, new Thailand() }, + { 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. };