Skip to content

Commit 9326541

Browse files
authored
Merge pull request #96 from deanology/NewCountries_8
New countries 8
2 parents ae9c1e5 + 1ff1608 commit 9326541

33 files changed

Lines changed: 1584 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 SaintBarthelemyTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Saint-Barthélemy";
6+
private const string NATIVE_NAME = "Saint-Barthélemy";
7+
private const string CAPITAL = "Gustavia";
8+
private const string OFFICIAL_NAME = "Collectivity of Saint-Barthélemy";
9+
private const string ISO2_CODE = "BL";
10+
private const string ISO3_CODE = "BLM";
11+
private const int NUMERIC_CODE = 652;
12+
private readonly string[] CALLING_CODE = ["+590"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintBarthelemy;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Saint-Barthélemy", "BL-BL", "Territory")
18+
];
19+
20+
[Fact]
21+
public void GetCountry_ReturnsCorrectInformation_ForSaintBarthelemy()
22+
{
23+
// Arrange
24+
// Act
25+
var country = CountryProvider.GetCountry(EXPECTEDID);
26+
27+
// Assert
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: 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 SaintHelenaTest : AssertCountryTestBase
4+
{
5+
private const string SAINTHELENA_COUNTRY_NAME = "Saint Helena";
6+
private const string SAINTHELENA_NATIVE_NAME = "Saint Helena";
7+
private const string SAINTHELENA_CAPITAL = "Jamestown";
8+
private const string SAINTHELENA_OFFICIAL_NAME = "Saint Helena, Ascension and Tristan da Cunha";
9+
private const string SAINTHELENA_ISO2_CODE = "SH";
10+
private const string SAINTHELENA_ISO3_CODE = "SHN";
11+
private const int SAINTHELENA_NUMERIC_CODE = 654;
12+
private readonly string[] SAINTHELENA_CALLING_CODE = ["+290"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintHelena;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Saint Helena", "SH-HL", "District"),
18+
new("Ascension", "SH-AC", "District"),
19+
new("Tristan da Cunha", "SH-TR", "District")
20+
];
21+
22+
[Fact]
23+
public void GetCountry_ReturnsCorrectInformation_ForSaintHelena()
24+
{
25+
// Arrange
26+
// Act
27+
var country = CountryProvider.GetCountry(EXPECTEDID);
28+
29+
// Assert
30+
AssertCorrectInformation(
31+
country,
32+
EXPECTEDID,
33+
SAINTHELENA_COUNTRY_NAME,
34+
SAINTHELENA_OFFICIAL_NAME,
35+
SAINTHELENA_NATIVE_NAME,
36+
SAINTHELENA_CAPITAL,
37+
SAINTHELENA_NUMERIC_CODE,
38+
SAINTHELENA_ISO2_CODE,
39+
SAINTHELENA_ISO3_CODE,
40+
SAINTHELENA_CALLING_CODE,
41+
EXPECTED_STATES
42+
);
43+
}
44+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 SaintKittsAndNevisTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Saint Kitts and Nevis";
12+
private const string NATIVE_NAME = "Saint Kitts and Nevis";
13+
private const string CAPITAL = "Basseterre";
14+
private const string OFFICIAL_NAME = "Federation of Saint Kitts and Nevis";
15+
private const string ISO2_CODE = "KN";
16+
private const string ISO3_CODE = "KNA";
17+
private const int NUMERIC_CODE = 659;
18+
private readonly string[] CALLING_CODE = ["+1-869"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintKittsAndNevis;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
[
23+
new("Saint Kitts", "KN-K", "Island"),
24+
new("Nevis", "KN-N", "Island")
25+
];
26+
27+
[Fact]
28+
public void GetCountry_ReturnsCorrectInformation_ForSaintKittsAndNevis()
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+
}
50+
51+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class SaintLuciaTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Saint Lucia";
6+
private const string NATIVE_NAME = "Saint Lucia";
7+
private const string CAPITAL = "Castries";
8+
private const string OFFICIAL_NAME = "Saint Lucia";
9+
private const string ISO2_CODE = "LC";
10+
private const string ISO3_CODE = "LCA";
11+
private const int NUMERIC_CODE = 662;
12+
private readonly string[] CALLING_CODE = ["+1-758"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintLucia;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Anse la Raye", "LC-01", "District"),
18+
new("Canaries", "LC-02", "District"),
19+
new("Castries", "LC-03", "District"),
20+
new("Choiseul", "LC-04", "District"),
21+
new("Dennery", "LC-05", "District"),
22+
new("Gros Islet", "LC-06", "District"),
23+
new("Laborie", "LC-07", "District"),
24+
new("Micoud", "LC-08", "District"),
25+
new("Praslin", "LC-09", "District"),
26+
new("Soufriere", "LC-10", "District"),
27+
new("Vieux Fort", "LC-11", "District")
28+
];
29+
30+
[Fact]
31+
public void GetCountry_ReturnsCorrectInformation_ForSaintLucia()
32+
{
33+
// Arrange
34+
// Act
35+
var country = CountryProvider.GetCountry(EXPECTEDID);
36+
37+
// Assert
38+
AssertCorrectInformation(
39+
country,
40+
EXPECTEDID,
41+
COUNTRY_NAME,
42+
OFFICIAL_NAME,
43+
NATIVE_NAME,
44+
CAPITAL,
45+
NUMERIC_CODE,
46+
ISO2_CODE,
47+
ISO3_CODE,
48+
CALLING_CODE,
49+
EXPECTED_STATES
50+
);
51+
}
52+
}
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 SaintMartinTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Saint-Martin";
12+
private const string NATIVE_NAME = "Saint-Martin";
13+
private const string CAPITAL = "Marigot";
14+
private const string OFFICIAL_NAME = "Collectivity of Saint-Martin";
15+
private const string ISO2_CODE = "MF";
16+
private const string ISO3_CODE = "MAF";
17+
private const int NUMERIC_CODE = 663;
18+
private readonly string[] CALLING_CODE = ["+590"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintMartinFrenchPart;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
[
23+
new("Saint-Martin", "MF-MF", "Territory")
24+
];
25+
26+
[Fact]
27+
public void GetCountry_ReturnsCorrectInformation_ForSaintMartin()
28+
{
29+
// Arrange
30+
// Act
31+
var country = CountryProvider.GetCountry(EXPECTEDID);
32+
33+
// Assert
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: 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 SaintPierreAndMiquelonTest : AssertCountryTestBase
4+
{
5+
private const string COUNTRY_NAME = "Saint Pierre and Miquelon";
6+
private const string NATIVE_NAME = "Saint Pierre and Miquelon";
7+
private const string CAPITAL = "Saint-Pierre";
8+
private const string OFFICIAL_NAME = "Saint Pierre and Miquelon";
9+
private const string ISO2_CODE = "PM";
10+
private const string ISO3_CODE = "SPM";
11+
private const int NUMERIC_CODE = 666;
12+
private readonly string[] CALLING_CODE = ["+508"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintPierreAndMiquelon;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Saint-Pierre", "PM-SP", "Commune"),
18+
new("Miquelon-Langlade", "PM-MQ", "Commune")
19+
];
20+
21+
[Fact]
22+
public void GetCountry_ReturnsCorrectInformation_ForSaintPierreAndMiquelon()
23+
{
24+
// Arrange
25+
// Act
26+
var country = CountryProvider.GetCountry(EXPECTEDID);
27+
28+
// Assert
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+

2+
namespace World.Net.UnitTests.Countries;
3+
4+
public sealed class SaintVincentAndTheGrenadinesTest : AssertCountryTestBase
5+
{
6+
private const string COUNTRY_NAME = "Saint Vincent and the Grenadines";
7+
private const string NATIVE_NAME = "Saint Vincent and the Grenadines";
8+
private const string CAPITAL = "Kingstown";
9+
private const string OFFICIAL_NAME = "Saint Vincent and the Grenadines";
10+
private const string ISO2_CODE = "VC";
11+
private const string ISO3_CODE = "VCT";
12+
private const int NUMERIC_CODE = 670;
13+
private readonly string[] CALLING_CODE = ["+1-784"];
14+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.SaintVincentAndTheGrenadines;
15+
16+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
17+
[
18+
new("Charlotte", "VC-C", "Parish"),
19+
new("Saint Andrew", "VC-A", "Parish"),
20+
new("Saint David", "VC-D", "Parish"),
21+
new("Saint George", "VC-G", "Parish"),
22+
new("Saint Patrick", "VC-P", "Parish"),
23+
new("Grenadines", "VC-VG", "Parish")
24+
];
25+
26+
[Fact]
27+
public void GetCountry_ReturnsCorrectInformation_ForSaintVincentAndTheGrenadines()
28+
{
29+
// Arrange
30+
// Act
31+
var country = CountryProvider.GetCountry(EXPECTEDID);
32+
33+
// Assert
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+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 SamoaTest : AssertCountryTestBase
10+
{
11+
private const string COUNTRY_NAME = "Samoa";
12+
private const string NATIVE_NAME = "Sāmoa";
13+
private const string CAPITAL = "Apia";
14+
private const string OFFICIAL_NAME = "Independent State of Samoa";
15+
private const string ISO2_CODE = "WS";
16+
private const string ISO3_CODE = "WSM";
17+
private const int NUMERIC_CODE = 882;
18+
private readonly string[] CALLING_CODE = ["+685"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Samoa;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
22+
[
23+
new("A'ana", "WS-AA", "District"),
24+
new("Aiga-i-le-Tai", "WS-AL", "District"),
25+
new("Atua", "WS-AT", "District"),
26+
new("Fa'asaleleaga", "WS-FS", "District"),
27+
new("Gaga'emauga", "WS-GE", "District"),
28+
new("Gaga'ifomauga", "WS-GF", "District"),
29+
new("Palauli", "WS-PA", "District"),
30+
new("Satupa'itea", "WS-SA", "District"),
31+
new("Tuamasaga", "WS-TU", "District"),
32+
new("Va'a-o-Fonoti", "WS-VF", "District"),
33+
new("Vaisigano", "WS-VS", "District")
34+
];
35+
36+
[Fact]
37+
public void GetCountry_ReturnsCorrectInformation_ForSamoa()
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+
}
59+
60+
}

0 commit comments

Comments
 (0)