Skip to content

Commit 1e71482

Browse files
authored
New countries 11 (#99)
* added details for more countries * updated country initializer * added details for more countries
1 parent b61d98a commit 1e71482

39 files changed

Lines changed: 1890 additions & 0 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class UgandaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Uganda";
6+
private const string NATIVE_NAME = "Uganda";
7+
private const string CAPITAL = "Kampala";
8+
private const string OFFICIAL_NAME = "Republic of Uganda";
9+
private const string ISO2_CODE = "UG";
10+
private const string ISO3_CODE = "UGA";
11+
private const int NUMERIC_CODE = 800;
12+
private readonly string[] CALLING_CODE = ["+256"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Uganda;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Central", "UG-C", "Region"),
18+
("Eastern", "UG-E", "Region"),
19+
("Northern", "UG-N", "Region"),
20+
("Western", "UG-W", "Region")
21+
};
22+
23+
[Fact]
24+
public void GetCountry_ReturnsCorrectInformation_ForUganda()
25+
{
26+
var country = CountryProvider.GetCountry(EXPECTEDID);
27+
28+
AssertCorrectInformation(
29+
country,
30+
EXPECTEDID,
31+
COUNTRY_NAME,
32+
OFFICIAL_NAME,
33+
NATIVE_NAME,
34+
CAPITAL,
35+
NUMERIC_CODE,
36+
ISO2_CODE,
37+
ISO3_CODE,
38+
CALLING_CODE,
39+
EXPECTED_STATES
40+
);
41+
}
42+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class UkraineTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Ukraine";
6+
private const string NATIVE_NAME = "Україна";
7+
private const string CAPITAL = "Kyiv";
8+
private const string OFFICIAL_NAME = "Ukraine";
9+
private const string ISO2_CODE = "UA";
10+
private const string ISO3_CODE = "UKR";
11+
private const int NUMERIC_CODE = 804;
12+
private readonly string[] CALLING_CODE = ["+380"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Ukraine;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Cherkasy", "UA-CK", "Oblast"),
18+
("Chernihiv", "UA-CH", "Oblast"),
19+
("Chernivtsi", "UA-CV", "Oblast"),
20+
("Dnipropetrovsk", "UA-DP", "Oblast"),
21+
("Donetsk", "UA-DO", "Oblast"),
22+
("Ivano-Frankivsk", "UA-IF", "Oblast"),
23+
("Kharkiv", "UA-KH", "Oblast"),
24+
("Kherson", "UA-KH", "Oblast"),
25+
("Khmelnytskyi", "UA-KM", "Oblast"),
26+
("Kirovohrad", "UA-KR", "Oblast"),
27+
("Kyiv", "UA-KY", "City"),
28+
("Kyiv Oblast", "UA-KY", "Oblast"),
29+
("Luhansk", "UA-LU", "Oblast"),
30+
("Lviv", "UA-LV", "Oblast"),
31+
("Mykolaiv", "UA-MK", "Oblast"),
32+
("Odessa", "UA-OD", "Oblast"),
33+
("Poltava", "UA-PL", "Oblast"),
34+
("Rivne", "UA-RV", "Oblast"),
35+
("Sevastopol", "UA-SE", "City"),
36+
("Sumy", "UA-SU", "Oblast"),
37+
("Ternopil", "UA-TE", "Oblast"),
38+
("Vinnytsia", "UA-VI", "Oblast"),
39+
("Volyn", "UA-VO", "Oblast"),
40+
("Zakarpattia", "UA-ZA", "Oblast"),
41+
("Zaporizhzhia", "UA-ZP", "Oblast"),
42+
("Zhytomyr", "UA-ZH", "Oblast"),
43+
("Autonomous Republic of Crimea", "UA-CR", "Autonomous Republic")
44+
};
45+
46+
[Fact]
47+
public void GetCountry_ReturnsCorrectInformation_ForUkraine()
48+
{
49+
var country = CountryProvider.GetCountry(EXPECTEDID);
50+
51+
AssertCorrectInformation(
52+
country,
53+
EXPECTEDID,
54+
COUNTRY_NAME,
55+
OFFICIAL_NAME,
56+
NATIVE_NAME,
57+
CAPITAL,
58+
NUMERIC_CODE,
59+
ISO2_CODE,
60+
ISO3_CODE,
61+
CALLING_CODE,
62+
EXPECTED_STATES
63+
);
64+
}
65+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 UnitedArabEmiratesTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "United Arab Emirates";
12+
private const string NATIVE_NAME = "الإمارات العربية المتحدة";
13+
private const string CAPITAL = "Abu Dhabi";
14+
private const string OFFICIAL_NAME = "United Arab Emirates";
15+
private const string ISO2_CODE = "AE";
16+
private const string ISO3_CODE = "ARE";
17+
private const int NUMERIC_CODE = 784;
18+
private readonly string[] CALLING_CODE = ["+971"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedArabEmirates;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("Abu Dhabi", "AE-AZ", "Emirate"),
24+
("Ajman", "AE-AJ", "Emirate"),
25+
("Dubai", "AE-DU", "Emirate"),
26+
("Fujairah", "AE-FU", "Emirate"),
27+
("Ras Al Khaimah", "AE-RK", "Emirate"),
28+
("Sharjah", "AE-SH", "Emirate"),
29+
("Umm Al Quwain", "AE-UQ", "Emirate")
30+
};
31+
32+
[Fact]
33+
public void GetCountry_ReturnsCorrectInformation_ForUAE()
34+
{
35+
var country = CountryProvider.GetCountry(EXPECTEDID);
36+
37+
AssertCorrectInformation(
38+
country,
39+
EXPECTEDID,
40+
COUNTRY_NAME,
41+
OFFICIAL_NAME,
42+
NATIVE_NAME,
43+
CAPITAL,
44+
NUMERIC_CODE,
45+
ISO2_CODE,
46+
ISO3_CODE,
47+
CALLING_CODE,
48+
EXPECTED_STATES
49+
);
50+
}
51+
}
52+
53+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 UnitedKingdomTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "United Kingdom";
12+
private const string NATIVE_NAME = "United Kingdom";
13+
private const string CAPITAL = "London";
14+
private const string OFFICIAL_NAME = "United Kingdom of Great Britain and Northern Ireland";
15+
private const string ISO2_CODE = "GB";
16+
private const string ISO3_CODE = "GBR";
17+
private const int NUMERIC_CODE = 826;
18+
private readonly string[] CALLING_CODE = ["+44"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedKingdom;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("England", "GB-ENG", "Country"),
24+
("Scotland", "GB-SCT", "Country"),
25+
("Wales", "GB-WLS", "Country"),
26+
("Northern Ireland", "GB-NIR", "Country")
27+
};
28+
29+
[Fact]
30+
public void GetCountry_ReturnsCorrectInformation_ForUnitedKingdom()
31+
{
32+
var country = CountryProvider.GetCountry(EXPECTEDID);
33+
34+
AssertCorrectInformation(
35+
country,
36+
EXPECTEDID,
37+
COUNTRY_NAME,
38+
OFFICIAL_NAME,
39+
NATIVE_NAME,
40+
CAPITAL,
41+
NUMERIC_CODE,
42+
ISO2_CODE,
43+
ISO3_CODE,
44+
CALLING_CODE,
45+
EXPECTED_STATES
46+
);
47+
}
48+
}
49+
50+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 UnitedStatesMinorOutlyingIslandsTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "United States Minor Outlying Islands";
12+
private const string NATIVE_NAME = "United States Minor Outlying Islands";
13+
private const string CAPITAL = null;
14+
private const string OFFICIAL_NAME = "United States Minor Outlying Islands";
15+
private const string ISO2_CODE = "UM";
16+
private const string ISO3_CODE = "UMI";
17+
private const int NUMERIC_CODE = 581;
18+
private readonly string[] CALLING_CODE = ["+1"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedStatesMinorOutlyingIslands;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = Array.Empty<(string, string, string)>();
22+
23+
[Fact]
24+
public void GetCountry_ReturnsCorrectInformation_ForUSMinorOutlyingIslands()
25+
{
26+
var country = CountryProvider.GetCountry(EXPECTEDID);
27+
28+
AssertCorrectInformation(
29+
country,
30+
EXPECTEDID,
31+
COUNTRY_NAME,
32+
OFFICIAL_NAME,
33+
NATIVE_NAME,
34+
CAPITAL,
35+
NUMERIC_CODE,
36+
ISO2_CODE,
37+
ISO3_CODE,
38+
CALLING_CODE,
39+
EXPECTED_STATES
40+
);
41+
}
42+
}
43+
44+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 UnitedStatesTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "United States";
12+
private const string NATIVE_NAME = "United States";
13+
private const string CAPITAL = "Washington, D.C.";
14+
private const string OFFICIAL_NAME = "United States of America";
15+
private const string ISO2_CODE = "US";
16+
private const string ISO3_CODE = "USA";
17+
private const int NUMERIC_CODE = 840;
18+
private readonly string[] CALLING_CODE = ["+1"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.UnitedStates;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
{
23+
("Alabama", "US-AL", "State"),
24+
("Alaska", "US-AK", "State"),
25+
("Arizona", "US-AZ", "State"),
26+
("Arkansas", "US-AR", "State"),
27+
("California", "US-CA", "State"),
28+
("Colorado", "US-CO", "State"),
29+
("Connecticut", "US-CT", "State"),
30+
("Delaware", "US-DE", "State"),
31+
("Florida", "US-FL", "State"),
32+
("Georgia", "US-GA", "State"),
33+
("Hawaii", "US-HI", "State"),
34+
("Idaho", "US-ID", "State"),
35+
("Illinois", "US-IL", "State"),
36+
("Indiana", "US-IN", "State"),
37+
("Iowa", "US-IA", "State"),
38+
("Kansas", "US-KS", "State"),
39+
("Kentucky", "US-KY", "State"),
40+
("Louisiana", "US-LA", "State"),
41+
("Maine", "US-ME", "State"),
42+
("Maryland", "US-MD", "State"),
43+
("Massachusetts", "US-MA", "State"),
44+
("Michigan", "US-MI", "State"),
45+
("Minnesota", "US-MN", "State"),
46+
("Mississippi", "US-MS", "State"),
47+
("Missouri", "US-MO", "State"),
48+
("Montana", "US-MT", "State"),
49+
("Nebraska", "US-NE", "State"),
50+
("Nevada", "US-NV", "State"),
51+
("New Hampshire", "US-NH", "State"),
52+
("New Jersey", "US-NJ", "State"),
53+
("New Mexico", "US-NM", "State"),
54+
("New York", "US-NY", "State"),
55+
("North Carolina", "US-NC", "State"),
56+
("North Dakota", "US-ND", "State"),
57+
("Ohio", "US-OH", "State"),
58+
("Oklahoma", "US-OK", "State"),
59+
("Oregon", "US-OR", "State"),
60+
("Pennsylvania", "US-PA", "State"),
61+
("Rhode Island", "US-RI", "State"),
62+
("South Carolina", "US-SC", "State"),
63+
("South Dakota", "US-SD", "State"),
64+
("Tennessee", "US-TN", "State"),
65+
("Texas", "US-TX", "State"),
66+
("Utah", "US-UT", "State"),
67+
("Vermont", "US-VT", "State"),
68+
("Virginia", "US-VA", "State"),
69+
("Washington", "US-WA", "State"),
70+
("West Virginia", "US-WV", "State"),
71+
("Wisconsin", "US-WI", "State"),
72+
("Wyoming", "US-WY", "State"),
73+
("District of Columbia", "US-DC", "Federal District")
74+
};
75+
76+
[Fact]
77+
public void GetCountry_ReturnsCorrectInformation_ForUnitedStates()
78+
{
79+
var country = CountryProvider.GetCountry(EXPECTEDID);
80+
81+
AssertCorrectInformation(
82+
country,
83+
EXPECTEDID,
84+
COUNTRY_NAME,
85+
OFFICIAL_NAME,
86+
NATIVE_NAME,
87+
CAPITAL,
88+
NUMERIC_CODE,
89+
ISO2_CODE,
90+
ISO3_CODE,
91+
CALLING_CODE,
92+
EXPECTED_STATES
93+
);
94+
}
95+
}
96+
97+
}

0 commit comments

Comments
 (0)