Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions src/World.Net.UnitTests/Countries/TaiwanTest.cs
Original file line number Diff line number Diff line change
@@ -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
);
}
}

}
43 changes: 43 additions & 0 deletions src/World.Net.UnitTests/Countries/TajikistanTest.cs
Original file line number Diff line number Diff line change
@@ -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
);
}
}
75 changes: 75 additions & 0 deletions src/World.Net.UnitTests/Countries/TanzaniaTest.cs
Original file line number Diff line number Diff line change
@@ -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
);
}
}
122 changes: 122 additions & 0 deletions src/World.Net.UnitTests/Countries/ThailandTest.cs
Original file line number Diff line number Diff line change
@@ -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
);
}
}

}
44 changes: 44 additions & 0 deletions src/World.Net.UnitTests/Countries/TheGambiaTest.cs
Original file line number Diff line number Diff line change
@@ -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
);
}
}
Loading