Skip to content

Commit 075d181

Browse files
authored
Merge pull request #97 from deanology/NewCountries_9
added details for more countries
2 parents 9326541 + f56168c commit 075d181

35 files changed

+1690
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SintMaartenTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Sint Maarten (Dutch part)";
6+
private const string NATIVE_NAME = "Sint Maarten";
7+
private const string CAPITAL = "Philipsburg";
8+
private const string OFFICIAL_NAME = "Sint Maarten";
9+
private const string ISO2_CODE = "SX";
10+
private const string ISO3_CODE = "SXM";
11+
private const int NUMERIC_CODE = 534;
12+
private readonly string[] CALLING_CODE = ["+1-721"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SintMaartenDutchPart;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
16+
17+
[Fact]
18+
public void GetCountry_ReturnsCorrectInformation_ForSintMaarten()
19+
{
20+
// Arrange
21+
// Act
22+
var country = CountryProvider.GetCountry(EXPECTEDID);
23+
24+
// Assert
25+
AssertCorrectInformation(
26+
country,
27+
EXPECTEDID,
28+
COUNTRY_NAME,
29+
OFFICIAL_NAME,
30+
NATIVE_NAME,
31+
CAPITAL,
32+
NUMERIC_CODE,
33+
ISO2_CODE,
34+
ISO3_CODE,
35+
CALLING_CODE,
36+
EXPECTED_STATES
37+
);
38+
}
39+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SlovakiaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Slovakia";
6+
private const string NATIVE_NAME = "Slovensko";
7+
private const string CAPITAL = "Bratislava";
8+
private const string OFFICIAL_NAME = "Slovak Republic";
9+
private const string ISO2_CODE = "SK";
10+
private const string ISO3_CODE = "SVK";
11+
private const int NUMERIC_CODE = 703;
12+
private readonly string[] CALLING_CODE = ["+421"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Slovakia;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Bratislava Region", "SK-BL", "Region"),
18+
("Trnava Region", "SK-TA", "Region"),
19+
("Trenčín Region", "SK-TC", "Region"),
20+
("Nitra Region", "SK-NI", "Region"),
21+
("Žilina Region", "SK-ZI", "Region"),
22+
("Banská Bystrica Region", "SK-BC", "Region"),
23+
("Prešov Region", "SK-PV", "Region"),
24+
("Košice Region", "SK-KI", "Region")
25+
};
26+
27+
[Fact]
28+
public void GetCountry_ReturnsCorrectInformation_ForSlovakia()
29+
{
30+
// Arrange
31+
// Act
32+
var country = CountryProvider.GetCountry(EXPECTEDID);
33+
34+
// Assert
35+
AssertCorrectInformation(
36+
country,
37+
EXPECTEDID,
38+
COUNTRY_NAME,
39+
OFFICIAL_NAME,
40+
NATIVE_NAME,
41+
CAPITAL,
42+
NUMERIC_CODE,
43+
ISO2_CODE,
44+
ISO3_CODE,
45+
CALLING_CODE,
46+
EXPECTED_STATES
47+
);
48+
}
49+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+

2+
namespace World.Net.UnitTests.Countries;
3+
4+
public sealed class SloveniaTest : AssertCountryTestBase
5+
{
6+
private const string COUNTRY_NAME = "Slovenia";
7+
private const string NATIVE_NAME = "Slovenija";
8+
private const string CAPITAL = "Ljubljana";
9+
private const string OFFICIAL_NAME = "Republic of Slovenia";
10+
private const string ISO2_CODE = "SI";
11+
private const string ISO3_CODE = "SVN";
12+
private const int NUMERIC_CODE = 705;
13+
private readonly string[] CALLING_CODE = ["+386"];
14+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Slovenia;
15+
16+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
17+
18+
[Fact]
19+
public void GetCountry_ReturnsCorrectInformation_ForSlovenia()
20+
{
21+
// Arrange
22+
// Act
23+
var country = CountryProvider.GetCountry(EXPECTEDID);
24+
25+
// Assert
26+
AssertCorrectInformation(
27+
country,
28+
EXPECTEDID,
29+
COUNTRY_NAME,
30+
OFFICIAL_NAME,
31+
NATIVE_NAME,
32+
CAPITAL,
33+
NUMERIC_CODE,
34+
ISO2_CODE,
35+
ISO3_CODE,
36+
CALLING_CODE,
37+
EXPECTED_STATES
38+
);
39+
}
40+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SolomonIslandsTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Solomon Islands";
6+
private const string NATIVE_NAME = "Solomon Islands";
7+
private const string CAPITAL = "Honiara";
8+
private const string OFFICIAL_NAME = "Solomon Islands";
9+
private const string ISO2_CODE = "SB";
10+
private const string ISO3_CODE = "SLB";
11+
private const int NUMERIC_CODE = 90;
12+
private readonly string[] CALLING_CODE = ["+677"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SolomonIslands;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Central Province", "SB-CE", "Province"),
18+
("Choiseul Province", "SB-CH", "Province"),
19+
("Guadalcanal Province", "SB-GU", "Province"),
20+
("Isabel Province", "SB-IS", "Province"),
21+
("Makira-Ulawa Province", "SB-MK", "Province"),
22+
("Malaita Province", "SB-ML", "Province"),
23+
("Rennell and Bellona Province", "SB-RB", "Province"),
24+
("Temotu Province", "SB-TE", "Province"),
25+
("Western Province", "SB-WE", "Province"),
26+
("Capital Territory (Honiara)", "SB-CT", "Capital Territory")
27+
};
28+
29+
[Fact]
30+
public void GetCountry_ReturnsCorrectInformation_ForSolomonIslands()
31+
{
32+
// Arrange
33+
// Act
34+
var country = CountryProvider.GetCountry(EXPECTEDID);
35+
36+
// Assert
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+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SomaliaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Somalia";
6+
private const string NATIVE_NAME = "Soomaaliya";
7+
private const string CAPITAL = "Mogadishu";
8+
private const string OFFICIAL_NAME = "Federal Republic of Somalia";
9+
private const string ISO2_CODE = "SO";
10+
private const string ISO3_CODE = "SOM";
11+
private const int NUMERIC_CODE = 706;
12+
private readonly string[] CALLING_CODE = ["+252"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Somalia;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Awdal", "SO-AW", "Region"),
18+
("Bakool", "SO-BK", "Region"),
19+
("Banaadir", "SO-BN", "Region"),
20+
("Bari", "SO-BR", "Region"),
21+
("Bay", "SO-BY", "Region"),
22+
("Galguduud", "SO-GA", "Region"),
23+
("Gedo", "SO-GE", "Region"),
24+
("Hiran", "SO-HI", "Region"),
25+
("Lower Juba", "SO-JH", "Region"),
26+
("Middle Juba", "SO-JD", "Region"),
27+
("Mudug", "SO-MU", "Region"),
28+
("Nugal", "SO-NU", "Region"),
29+
("Sanaag", "SO-SA", "Region"),
30+
("Middle Shabelle", "SO-SD", "Region"),
31+
("Lower Shabelle", "SO-SH", "Region"),
32+
("Sool", "SO-SO", "Region"),
33+
("Togdheer", "SO-TO", "Region"),
34+
("Woqooyi Galbeed", "SO-WO", "Region")
35+
};
36+
37+
[Fact]
38+
public void GetCountry_ReturnsCorrectInformation_ForSomalia()
39+
{
40+
// Arrange
41+
// Act
42+
var country = CountryProvider.GetCountry(EXPECTEDID);
43+
44+
// Assert
45+
AssertCorrectInformation(
46+
country,
47+
EXPECTEDID,
48+
COUNTRY_NAME,
49+
OFFICIAL_NAME,
50+
NATIVE_NAME,
51+
CAPITAL,
52+
NUMERIC_CODE,
53+
ISO2_CODE,
54+
ISO3_CODE,
55+
CALLING_CODE,
56+
EXPECTED_STATES
57+
);
58+
}
59+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SouthAfricaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "South Africa";
6+
private const string NATIVE_NAME = "South Africa";
7+
private const string CAPITAL = "Pretoria";
8+
private const string OFFICIAL_NAME = "Republic of South Africa";
9+
private const string ISO2_CODE = "ZA";
10+
private const string ISO3_CODE = "ZAF";
11+
private const int NUMERIC_CODE = 710;
12+
private readonly string[] CALLING_CODE = ["+27"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SouthAfrica;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Eastern Cape", "ZA-EC", "Province"),
18+
("Free State", "ZA-FS", "Province"),
19+
("Gauteng", "ZA-GT", "Province"),
20+
("KwaZulu-Natal", "ZA-KZN", "Province"),
21+
("Limpopo", "ZA-LP", "Province"),
22+
("Mpumalanga", "ZA-MP", "Province"),
23+
("North West", "ZA-NW", "Province"),
24+
("Northern Cape", "ZA-NC", "Province"),
25+
("Western Cape", "ZA-WC", "Province")
26+
};
27+
28+
[Fact]
29+
public void GetCountry_ReturnsCorrectInformation_ForSouthAfrica()
30+
{
31+
// Arrange
32+
// Act
33+
var country = CountryProvider.GetCountry(EXPECTEDID);
34+
35+
// Assert
36+
AssertCorrectInformation(
37+
country,
38+
EXPECTEDID,
39+
COUNTRY_NAME,
40+
OFFICIAL_NAME,
41+
NATIVE_NAME,
42+
CAPITAL,
43+
NUMERIC_CODE,
44+
ISO2_CODE,
45+
ISO3_CODE,
46+
CALLING_CODE,
47+
EXPECTED_STATES
48+
);
49+
}
50+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SouthGeorgiaAndTheSouthSandwichIslandsTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "South Georgia and the South Sandwich Islands";
6+
private const string NATIVE_NAME = "South Georgia and the South Sandwich Islands";
7+
private const string CAPITAL = "King Edward Point";
8+
private const string OFFICIAL_NAME = "South Georgia and the South Sandwich Islands";
9+
private const string ISO2_CODE = "GS";
10+
private const string ISO3_CODE = "SGS";
11+
private const int NUMERIC_CODE = 239;
12+
private readonly string[] CALLING_CODE = [];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SouthGeorgia;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
16+
17+
[Fact]
18+
public void GetCountry_ReturnsCorrectInformation_ForSouthGeorgiaAndTheSouthSandwichIslands()
19+
{
20+
// Arrange
21+
// Act
22+
var country = CountryProvider.GetCountry(EXPECTEDID);
23+
24+
// Assert
25+
AssertCorrectInformation(
26+
country,
27+
EXPECTEDID,
28+
COUNTRY_NAME,
29+
OFFICIAL_NAME,
30+
NATIVE_NAME,
31+
CAPITAL,
32+
NUMERIC_CODE,
33+
ISO2_CODE,
34+
ISO3_CODE,
35+
CALLING_CODE,
36+
EXPECTED_STATES
37+
);
38+
}
39+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SouthKoreaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "South Korea";
6+
private const string NATIVE_NAME = "대한민국";
7+
private const string CAPITAL = "Seoul";
8+
private const string OFFICIAL_NAME = "Republic of Korea";
9+
private const string ISO2_CODE = "KR";
10+
private const string ISO3_CODE = "KOR";
11+
private const int NUMERIC_CODE = 410;
12+
private readonly string[] CALLING_CODE = ["+82"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SouthKorea;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
{
17+
("Seoul", "KR-11", "Special City"),
18+
("Busan", "KR-26", "Metropolitan City"),
19+
("Daegu", "KR-27", "Metropolitan City"),
20+
("Incheon", "KR-28", "Metropolitan City"),
21+
("Gwangju", "KR-29", "Metropolitan City"),
22+
("Daejeon", "KR-30", "Metropolitan City"),
23+
("Ulsan", "KR-31", "Metropolitan City"),
24+
("Sejong", "KR-50", "Special Self-Governing City"),
25+
("Gyeonggi", "KR-41", "Province"),
26+
("Gangwon", "KR-42", "Province"),
27+
("North Chungcheong", "KR-43", "Province"),
28+
("South Chungcheong", "KR-44", "Province"),
29+
("North Jeolla", "KR-45", "Province"),
30+
("South Jeolla", "KR-46", "Province"),
31+
("North Gyeongsang", "KR-47", "Province"),
32+
("South Gyeongsang", "KR-48", "Province"),
33+
("Jeju", "KR-49", "Special Self-Governing Province")
34+
};
35+
36+
[Fact]
37+
public void GetCountry_ReturnsCorrectInformation_ForSouthKorea()
38+
{
39+
// Arrange
40+
// Act
41+
var country = CountryProvider.GetCountry(EXPECTEDID);
42+
43+
// Assert
44+
AssertCorrectInformation(
45+
country,
46+
EXPECTEDID,
47+
COUNTRY_NAME,
48+
OFFICIAL_NAME,
49+
NATIVE_NAME,
50+
CAPITAL,
51+
NUMERIC_CODE,
52+
ISO2_CODE,
53+
ISO3_CODE,
54+
CALLING_CODE,
55+
EXPECTED_STATES
56+
);
57+
}
58+
}

0 commit comments

Comments
 (0)