Skip to content

Commit b61d98a

Browse files
authored
New countries 10 (#98)
* added details for more countries * updated country initializer
1 parent 075d181 commit b61d98a

29 files changed

+1537
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace World.Net.UnitTests.Countries
8+
{
9+
public sealed class TaiwanTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Taiwan";
12+
private const string NATIVE_NAME = "臺灣";
13+
private const string CAPITAL = "Taipei";
14+
private const string OFFICIAL_NAME = "Republic of China (Taiwan)";
15+
private const string ISO2_CODE = "TW";
16+
private const string ISO3_CODE = "TWN";
17+
private const int NUMERIC_CODE = 158;
18+
private readonly string[] CALLING_CODE = ["+886"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Taiwan;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("Taipei", "TW-TPE", "Municipality"),
24+
("New Taipei", "TW-NWT", "Municipality"),
25+
("Taoyuan", "TW-TAO", "Municipality"),
26+
("Taichung", "TW-TXG", "Municipality"),
27+
("Tainan", "TW-TNN", "Municipality"),
28+
("Kaohsiung", "TW-KHH", "Municipality"),
29+
("Keelung", "TW-KEE", "City"),
30+
("Hsinchu", "TW-HSZ", "City"),
31+
("Chiayi", "TW-CYI", "City"),
32+
("Changhua", "TW-CWH", "County"),
33+
("Chiayi County", "TW-CYQ", "County"),
34+
("Hsinchu County", "TW-HSQ", "County"),
35+
("Hualien", "TW-HWA", "County"),
36+
("Kaohsiung County", "TW-KAQ", "County"),
37+
("Miaoli", "TW-MIA", "County"),
38+
("Nantou", "TW-NAN", "County"),
39+
("Penghu", "TW-PEN", "County"),
40+
("Pingtung", "TW-PIF", "County"),
41+
("Yilan", "TW-YIL", "County"),
42+
("Yunlin", "TW-YUN", "County"),
43+
("Taitung", "TW-TTT", "County"),
44+
("Lienchiang", "TW-LIE", "County")
45+
};
46+
47+
[Fact]
48+
public void GetCountry_ReturnsCorrectInformation_ForTaiwan()
49+
{
50+
var country = CountryProvider.GetCountry(EXPECTEDID);
51+
52+
AssertCorrectInformation(
53+
country,
54+
EXPECTEDID,
55+
COUNTRY_NAME,
56+
OFFICIAL_NAME,
57+
NATIVE_NAME,
58+
CAPITAL,
59+
NUMERIC_CODE,
60+
ISO2_CODE,
61+
ISO3_CODE,
62+
CALLING_CODE,
63+
EXPECTED_STATES
64+
);
65+
}
66+
}
67+
68+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class TajikistanTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Tajikistan";
6+
private const string NATIVE_NAME = "Ҷумҳурии Тоҷикистон";
7+
private const string CAPITAL = "Dushanbe";
8+
private const string OFFICIAL_NAME = "Republic of Tajikistan";
9+
private const string ISO2_CODE = "TJ";
10+
private const string ISO3_CODE = "TJK";
11+
private const int NUMERIC_CODE = 762;
12+
private readonly string[] CALLING_CODE = ["+992"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tajikistan;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Sughd", "TJ-SU", "Region"),
18+
("Khatlon", "TJ-KT", "Region"),
19+
("Gorno-Badakhshan", "TJ-GBAO", "Autonomous Region"),
20+
("Districts of Republican Subordination", "TJ-DRS", "Region"),
21+
("Dushanbe", "TJ-DU", "Capital District")
22+
};
23+
24+
[Fact]
25+
public void GetCountry_ReturnsCorrectInformation_ForTajikistan()
26+
{
27+
var country = CountryProvider.GetCountry(EXPECTEDID);
28+
29+
AssertCorrectInformation(
30+
country,
31+
EXPECTEDID,
32+
COUNTRY_NAME,
33+
OFFICIAL_NAME,
34+
NATIVE_NAME,
35+
CAPITAL,
36+
NUMERIC_CODE,
37+
ISO2_CODE,
38+
ISO3_CODE,
39+
CALLING_CODE,
40+
EXPECTED_STATES
41+
);
42+
}
43+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace World.Net.UnitTests.Countries;
8+
9+
public sealed class TanzaniaTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Tanzania";
12+
private const string NATIVE_NAME = "Jamhuri ya Muungano wa Tanzania";
13+
private const string CAPITAL = "Dodoma";
14+
private const string OFFICIAL_NAME = "United Republic of Tanzania";
15+
private const string ISO2_CODE = "TZ";
16+
private const string ISO3_CODE = "TZA";
17+
private const int NUMERIC_CODE = 834;
18+
private readonly string[] CALLING_CODE = ["+255"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Tanzania;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("Arusha", "TZ-AR", "Region"),
24+
("Dar es Salaam", "TZ-DA", "Region"),
25+
("Dodoma", "TZ-DO", "Region"),
26+
("Geita", "TZ-GE", "Region"),
27+
("Iringa", "TZ-IR", "Region"),
28+
("Kagera", "TZ-KA", "Region"),
29+
("Katavi", "TZ-KT", "Region"),
30+
("Kigoma", "TZ-KI", "Region"),
31+
("Kilimanjaro", "TZ-KL", "Region"),
32+
("Lindi", "TZ-LI", "Region"),
33+
("Manyara", "TZ-MA", "Region"),
34+
("Mara", "TZ-MR", "Region"),
35+
("Mbeya", "TZ-MB", "Region"),
36+
("Morogoro", "TZ-MO", "Region"),
37+
("Mtwara", "TZ-MT", "Region"),
38+
("Mwanza", "TZ-MW", "Region"),
39+
("Njombe", "TZ-NJ", "Region"),
40+
("Pwani", "TZ-PW", "Region"),
41+
("Rukwa", "TZ-RU", "Region"),
42+
("Ruvuma", "TZ-RV", "Region"),
43+
("Shinyanga", "TZ-SH", "Region"),
44+
("Simiyu", "TZ-SI", "Region"),
45+
("Singida", "TZ-SN", "Region"),
46+
("Tabora", "TZ-TA", "Region"),
47+
("Tanga", "TZ-TE", "Region"),
48+
("Songwe", "TZ-SO", "Region"),
49+
("Zanzibar North", "TZ-ZN", "Region"),
50+
("Zanzibar South", "TZ-ZS", "Region"),
51+
("Zanzibar Central/South", "TZ-ZC", "Region"),
52+
("Zanzibar West", "TZ-ZW", "Region"),
53+
("Zanzibar Urban/West", "TZ-ZU", "Region")
54+
};
55+
56+
[Fact]
57+
public void GetCountry_ReturnsCorrectInformation_ForTanzania()
58+
{
59+
var country = CountryProvider.GetCountry(EXPECTEDID);
60+
61+
AssertCorrectInformation(
62+
country,
63+
EXPECTEDID,
64+
COUNTRY_NAME,
65+
OFFICIAL_NAME,
66+
NATIVE_NAME,
67+
CAPITAL,
68+
NUMERIC_CODE,
69+
ISO2_CODE,
70+
ISO3_CODE,
71+
CALLING_CODE,
72+
EXPECTED_STATES
73+
);
74+
}
75+
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace World.Net.UnitTests.Countries
8+
{
9+
public sealed class ThailandTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Thailand";
12+
private const string NATIVE_NAME = "ประเทศไทย";
13+
private const string CAPITAL = "Bangkok";
14+
private const string OFFICIAL_NAME = "Kingdom of Thailand";
15+
private const string ISO2_CODE = "TH";
16+
private const string ISO3_CODE = "THA";
17+
private const int NUMERIC_CODE = 764;
18+
private readonly string[] CALLING_CODE = ["+66"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Thailand;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("Amnat Charoen", "TH-37", "Province"),
24+
("Ang Thong", "TH-15", "Province"),
25+
("Bangkok", "TH-10", "Province"),
26+
("Bueng Kan", "TH-38", "Province"),
27+
("Buri Ram", "TH-31", "Province"),
28+
("Chachoengsao", "TH-24", "Province"),
29+
("Chai Nat", "TH-18", "Province"),
30+
("Chaiyaphum", "TH-36", "Province"),
31+
("Chanthaburi", "TH-22", "Province"),
32+
("Chiang Mai", "TH-50", "Province"),
33+
("Chiang Rai", "TH-57", "Province"),
34+
("Chonburi", "TH-20", "Province"),
35+
("Chumphon", "TH-86", "Province"),
36+
("Kalasin", "TH-46", "Province"),
37+
("Kamphaeng Phet", "TH-62", "Province"),
38+
("Kanchanaburi", "TH-71", "Province"),
39+
("Khon Kaen", "TH-40", "Province"),
40+
("Krabi", "TH-81", "Province"),
41+
("Lampang", "TH-52", "Province"),
42+
("Lamphun", "TH-51", "Province"),
43+
("Loei", "TH-42", "Province"),
44+
("Lopburi", "TH-16", "Province"),
45+
("Mae Hong Son", "TH-58", "Province"),
46+
("Maha Sarakham", "TH-44", "Province"),
47+
("Mukdahan", "TH-49", "Province"),
48+
("Nakhon Nayok", "TH-26", "Province"),
49+
("Nakhon Pathom", "TH-73", "Province"),
50+
("Nakhon Phanom", "TH-48", "Province"),
51+
("Nakhon Ratchasima", "TH-30", "Province"),
52+
("Nakhon Sawan", "TH-60", "Province"),
53+
("Nakhon Si Thammarat", "TH-80", "Province"),
54+
("Nan", "TH-55", "Province"),
55+
("Narathiwat", "TH-96", "Province"),
56+
("Nong Bua Lamphu", "TH-39", "Province"),
57+
("Nong Khai", "TH-43", "Province"),
58+
("Nonthaburi", "TH-12", "Province"),
59+
("Pathum Thani", "TH-13", "Province"),
60+
("Pattani", "TH-94", "Province"),
61+
("Phang Nga", "TH-82", "Province"),
62+
("Phatthalung", "TH-93", "Province"),
63+
("Phayao", "TH-56", "Province"),
64+
("Phetchabun", "TH-67", "Province"),
65+
("Phetchaburi", "TH-76", "Province"),
66+
("Phichit", "TH-66", "Province"),
67+
("Phitsanulok", "TH-65", "Province"),
68+
("Phra Nakhon Si Ayutthaya", "TH-14", "Province"),
69+
("Phrae", "TH-54", "Province"),
70+
("Phuket", "TH-83", "Province"),
71+
("Prachinburi", "TH-25", "Province"),
72+
("Prachuap Khiri Khan", "TH-77", "Province"),
73+
("Ranong", "TH-85", "Province"),
74+
("Ratchaburi", "TH-70", "Province"),
75+
("Rayong", "TH-21", "Province"),
76+
("Roi Et", "TH-45", "Province"),
77+
("Sa Kaeo", "TH-27", "Province"),
78+
("Sakon Nakhon", "TH-47", "Province"),
79+
("Samut Prakan", "TH-11", "Province"),
80+
("Samut Sakhon", "TH-74", "Province"),
81+
("Samut Songkhram", "TH-75", "Province"),
82+
("Saraburi", "TH-19", "Province"),
83+
("Satun", "TH-91", "Province"),
84+
("Sing Buri", "TH-17", "Province"),
85+
("Si Sa Ket", "TH-33", "Province"),
86+
("Songkhla", "TH-90", "Province"),
87+
("Sukhothai", "TH-64", "Province"),
88+
("Suphan Buri", "TH-72", "Province"),
89+
("Surat Thani", "TH-84", "Province"),
90+
("Tak", "TH-63", "Province"),
91+
("Trang", "TH-92", "Province"),
92+
("Trat", "TH-23", "Province"),
93+
("Ubon Ratchathani", "TH-34", "Province"),
94+
("Udon Thani", "TH-41", "Province"),
95+
("Uthai Thani", "TH-61", "Province"),
96+
("Uttaradit", "TH-53", "Province"),
97+
("Yala", "TH-95", "Province"),
98+
("Yasothon", "TH-35", "Province")
99+
};
100+
101+
[Fact]
102+
public void GetCountry_ReturnsCorrectInformation_ForThailand()
103+
{
104+
var country = CountryProvider.GetCountry(EXPECTEDID);
105+
106+
AssertCorrectInformation(
107+
country,
108+
EXPECTEDID,
109+
COUNTRY_NAME,
110+
OFFICIAL_NAME,
111+
NATIVE_NAME,
112+
CAPITAL,
113+
NUMERIC_CODE,
114+
ISO2_CODE,
115+
ISO3_CODE,
116+
CALLING_CODE,
117+
EXPECTED_STATES
118+
);
119+
}
120+
}
121+
122+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class TheGambiaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "The Gambia";
6+
private const string NATIVE_NAME = "The Gambia";
7+
private const string CAPITAL = "Banjul";
8+
private const string OFFICIAL_NAME = "Republic of The Gambia";
9+
private const string ISO2_CODE = "GM";
10+
private const string ISO3_CODE = "GMB";
11+
private const int NUMERIC_CODE = 270;
12+
private readonly string[] CALLING_CODE = ["+220"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Gambia;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Banjul", "GM-B", "City"),
18+
("Central River", "GM-CR", "Region"),
19+
("Lower River", "GM-LR", "Region"),
20+
("North Bank", "GM-NB", "Region"),
21+
("Upper River", "GM-UR", "Region"),
22+
("Western", "GM-W", "Region")
23+
};
24+
25+
[Fact]
26+
public void GetCountry_ReturnsCorrectInformation_ForTheGambia()
27+
{
28+
var country = CountryProvider.GetCountry(EXPECTEDID);
29+
30+
AssertCorrectInformation(
31+
country,
32+
EXPECTEDID,
33+
COUNTRY_NAME,
34+
OFFICIAL_NAME,
35+
NATIVE_NAME,
36+
CAPITAL,
37+
NUMERIC_CODE,
38+
ISO2_CODE,
39+
ISO3_CODE,
40+
CALLING_CODE,
41+
EXPECTED_STATES
42+
);
43+
}
44+
}

0 commit comments

Comments
 (0)