Skip to content

Commit 96be2ca

Browse files
authored
Grenada, Guadeloupe, Gaum, Guatemala, Guernsey, Guinea (#90)
1 parent a77a45f commit 96be2ca

File tree

13 files changed

+544
-0
lines changed

13 files changed

+544
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class GrenadaTest : AssertCountryTestBase
4+
{
5+
private const string GRENADA_COUNTRY_NAME = "Grenada";
6+
private const string GRENADA_NATIVE_NAME = "Grenada";
7+
private const string GRENADA_CAPITAL = "St. George's";
8+
private const string GRENADA_OFFICIAL_NAME = "Grenada";
9+
private const string GRENADA_ISO2_CODE = "GD";
10+
private const string GRENADA_ISO3_CODE = "GRD";
11+
private const int GRENADA_NUMERIC_CODE = 308;
12+
private readonly string[] GRENADA_CALLING_CODE = ["+1-473"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Grenada;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Saint Andrew", "GD-01", "Parish"),
18+
new("Saint David", "GD-02", "Parish"),
19+
new("Saint George", "GD-03", "Parish"),
20+
new("Saint John", "GD-04", "Parish"),
21+
new("Saint Mark", "GD-05", "Parish"),
22+
new("Saint Patrick", "GD-06", "Parish"),
23+
new("Carriacou and Petite Martinique", "GD-10", "Dependency")
24+
];
25+
26+
[Fact]
27+
public void GetCountry_ReturnsCorrectInformation_ForGrenada()
28+
{
29+
// Arrange
30+
// Act
31+
var country = CountryProvider.GetCountry(EXPECTEDID);
32+
33+
// Assert
34+
AssertCorrectInformation(
35+
country,
36+
EXPECTEDID,
37+
GRENADA_COUNTRY_NAME,
38+
GRENADA_OFFICIAL_NAME,
39+
GRENADA_NATIVE_NAME,
40+
GRENADA_CAPITAL,
41+
GRENADA_NUMERIC_CODE,
42+
GRENADA_ISO2_CODE,
43+
GRENADA_ISO3_CODE,
44+
GRENADA_CALLING_CODE,
45+
EXPECTED_STATES
46+
);
47+
}
48+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 GuadeloupeTest : AssertCountryTestBase
10+
{
11+
private const string GUADELOUPE_COUNTRY_NAME = "Guadeloupe";
12+
private const string GUADELOUPE_NATIVE_NAME = "Guadeloupe";
13+
private const string GUADELOUPE_CAPITAL = "Basse-Terre";
14+
private const string GUADELOUPE_OFFICIAL_NAME = "Guadeloupe";
15+
private const string GUADELOUPE_ISO2_CODE = "GP";
16+
private const string GUADELOUPE_ISO3_CODE = "GLP";
17+
private const int GUADELOUPE_NUMERIC_CODE = 312;
18+
private readonly string[] GUADELOUPE_CALLING_CODE = ["+590"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Guadeloupe;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
22+
23+
[Fact]
24+
public void GetCountry_ReturnsCorrectInformation_ForGuadeloupe()
25+
{
26+
// Arrange
27+
// Act
28+
var country = CountryProvider.GetCountry(EXPECTEDID);
29+
30+
// Assert
31+
AssertCorrectInformation(
32+
country,
33+
EXPECTEDID,
34+
GUADELOUPE_COUNTRY_NAME,
35+
GUADELOUPE_OFFICIAL_NAME,
36+
GUADELOUPE_NATIVE_NAME,
37+
GUADELOUPE_CAPITAL,
38+
GUADELOUPE_NUMERIC_CODE,
39+
GUADELOUPE_ISO2_CODE,
40+
GUADELOUPE_ISO3_CODE,
41+
GUADELOUPE_CALLING_CODE,
42+
EXPECTED_STATES
43+
);
44+
}
45+
}
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 GuamTest : AssertCountryTestBase
10+
{
11+
private const string GUAM_COUNTRY_NAME = "Guam";
12+
private const string GUAM_NATIVE_NAME = "Guam";
13+
private const string GUAM_CAPITAL = "Hagåtña";
14+
private const string GUAM_OFFICIAL_NAME = "Guam";
15+
private const string GUAM_ISO2_CODE = "GU";
16+
private const string GUAM_ISO3_CODE = "GUM";
17+
private const int GUAM_NUMERIC_CODE = 316;
18+
private readonly string[] GUAM_CALLING_CODE = ["+1-671"];
19+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Guam;
20+
21+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
22+
23+
[Fact]
24+
public void GetCountry_ReturnsCorrectInformation_ForGuam()
25+
{
26+
// Arrange
27+
// Act
28+
var country = CountryProvider.GetCountry(EXPECTEDID);
29+
30+
// Assert
31+
AssertCorrectInformation(
32+
country,
33+
EXPECTEDID,
34+
GUAM_COUNTRY_NAME,
35+
GUAM_OFFICIAL_NAME,
36+
GUAM_NATIVE_NAME,
37+
GUAM_CAPITAL,
38+
GUAM_NUMERIC_CODE,
39+
GUAM_ISO2_CODE,
40+
GUAM_ISO3_CODE,
41+
GUAM_CALLING_CODE,
42+
EXPECTED_STATES
43+
);
44+
}
45+
}
46+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class GuatemalaTest : AssertCountryTestBase
4+
{
5+
private const string GUATEMALA_COUNTRY_NAME = "Guatemala";
6+
private const string GUATEMALA_NATIVE_NAME = "Guatemala";
7+
private const string GUATEMALA_CAPITAL = "Guatemala City";
8+
private const string GUATEMALA_OFFICIAL_NAME = "Republic of Guatemala";
9+
private const string GUATEMALA_ISO2_CODE = "GT";
10+
private const string GUATEMALA_ISO3_CODE = "GTM";
11+
private const int GUATEMALA_NUMERIC_CODE = 320;
12+
private readonly string[] GUATEMALA_CALLING_CODE = ["+502"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Guatemala;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Alta Verapaz", "GT-AV", "Department"),
18+
new("Baja Verapaz", "GT-BV", "Department"),
19+
new("Chimaltenango", "GT-CM", "Department"),
20+
new("Chiquimula", "GT-CQ", "Department"),
21+
new("El Progreso", "GT-PR", "Department"),
22+
new("Escuintla", "GT-ES", "Department"),
23+
new("Guatemala", "GT-GU", "Department"),
24+
new("Huehuetenango", "GT-HU", "Department"),
25+
new("Izabal", "GT-IZ", "Department"),
26+
new("Jalapa", "GT-JA", "Department"),
27+
new("Jutiapa", "GT-JU", "Department"),
28+
new("Petén", "GT-PE", "Department"),
29+
new("Quetzaltenango", "GT-QZ", "Department"),
30+
new("Quiché", "GT-QC", "Department"),
31+
new("Retalhuleu", "GT-RE", "Department"),
32+
new("Sacatepéquez", "GT-SA", "Department"),
33+
new("San Marcos", "GT-SM", "Department"),
34+
new("Santa Rosa", "GT-SR", "Department"),
35+
new("Sololá", "GT-SO", "Department"),
36+
new("Suchitepéquez", "GT-SU", "Department"),
37+
new("Totonicapán", "GT-TO", "Department"),
38+
new("Zacapa", "GT-ZA", "Department")
39+
];
40+
41+
[Fact]
42+
public void GetCountry_ReturnsCorrectInformation_ForGuatemala()
43+
{
44+
// Arrange
45+
// Act
46+
var country = CountryProvider.GetCountry(EXPECTEDID);
47+
48+
// Assert
49+
AssertCorrectInformation(
50+
country,
51+
EXPECTEDID,
52+
GUATEMALA_COUNTRY_NAME,
53+
GUATEMALA_OFFICIAL_NAME,
54+
GUATEMALA_NATIVE_NAME,
55+
GUATEMALA_CAPITAL,
56+
GUATEMALA_NUMERIC_CODE,
57+
GUATEMALA_ISO2_CODE,
58+
GUATEMALA_ISO3_CODE,
59+
GUATEMALA_CALLING_CODE,
60+
EXPECTED_STATES
61+
);
62+
}
63+
}
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 GuernseyTest : AssertCountryTestBase
4+
{
5+
private const string GUERNSEY_COUNTRY_NAME = "Guernsey";
6+
private const string GUERNSEY_NATIVE_NAME = "Guernsey";
7+
private const string GUERNSEY_CAPITAL = "St. Peter Port";
8+
private const string GUERNSEY_OFFICIAL_NAME = "Guernsey";
9+
private const string GUERNSEY_ISO2_CODE = "GG";
10+
private const string GUERNSEY_ISO3_CODE = "GGY";
11+
private const int GUERNSEY_NUMERIC_CODE = 831;
12+
private readonly string[] GUERNSEY_CALLING_CODE = ["+44-1481"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.GuernseyAndAlderney;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];
16+
17+
[Fact]
18+
public void GetCountry_ReturnsCorrectInformation_ForGuernsey()
19+
{
20+
// Arrange
21+
// Act
22+
var country = CountryProvider.GetCountry(EXPECTEDID);
23+
24+
// Assert
25+
AssertCorrectInformation(
26+
country,
27+
EXPECTEDID,
28+
GUERNSEY_COUNTRY_NAME,
29+
GUERNSEY_OFFICIAL_NAME,
30+
GUERNSEY_NATIVE_NAME,
31+
GUERNSEY_CAPITAL,
32+
GUERNSEY_NUMERIC_CODE,
33+
GUERNSEY_ISO2_CODE,
34+
GUERNSEY_ISO3_CODE,
35+
GUERNSEY_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 GuineaTest : AssertCountryTestBase
4+
{
5+
private const string GUINEA_COUNTRY_NAME = "Guinea";
6+
private const string GUINEA_NATIVE_NAME = "Guinée";
7+
private const string GUINEA_CAPITAL = "Conakry";
8+
private const string GUINEA_OFFICIAL_NAME = "Republic of Guinea";
9+
private const string GUINEA_ISO2_CODE = "GN";
10+
private const string GUINEA_ISO3_CODE = "GIN";
11+
private const int GUINEA_NUMERIC_CODE = 324;
12+
private readonly string[] GUINEA_CALLING_CODE = ["+224"];
13+
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Guinea;
14+
15+
private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
16+
[
17+
new("Boké", "GN-B", "Region"),
18+
new("Conakry", "GN-C", "Region"),
19+
new("Faranah", "GN-F", "Region"),
20+
new("Kankan", "GN-K", "Region"),
21+
new("Kindia", "GN-D", "Region"),
22+
new("Labé", "GN-L", "Region"),
23+
new("Mamou", "GN-M", "Region"),
24+
new("Nzérékoré", "GN-N", "Region")
25+
];
26+
27+
[Fact]
28+
public void GetCountry_ReturnsCorrectInformation_ForGuinea()
29+
{
30+
// Arrange
31+
// Act
32+
var country = CountryProvider.GetCountry(EXPECTEDID);
33+
34+
// Assert
35+
AssertCorrectInformation(
36+
country,
37+
EXPECTEDID,
38+
GUINEA_COUNTRY_NAME,
39+
GUINEA_OFFICIAL_NAME,
40+
GUINEA_NATIVE_NAME,
41+
GUINEA_CAPITAL,
42+
GUINEA_NUMERIC_CODE,
43+
GUINEA_ISO2_CODE,
44+
GUINEA_ISO3_CODE,
45+
GUINEA_CALLING_CODE,
46+
EXPECTED_STATES
47+
);
48+
}
49+
}

src/World.Net/Countries/Grenada.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace World.Net.Countries;
2+
3+
internal sealed class Grenada : ICountry
4+
{
5+
//<inheritdoc/>
6+
public CountryIdentifier Id => CountryIdentifier.Grenada;
7+
8+
//<inheritdoc/>
9+
public string Name { get; } = "Grenada";
10+
11+
//<inheritdoc/>
12+
public string OfficialName { get; } = "Grenada";
13+
14+
//<inheritdoc/>
15+
public string NativeName => "Grenada";
16+
17+
//<inheritdoc/>
18+
public string Capital { get; } = "St. George's";
19+
20+
//<inheritdoc/>
21+
public int NumericCode { get; } = 308;
22+
23+
//<inheritdoc/>
24+
public string ISO2Code { get; } = "GD";
25+
26+
//<inheritdoc/>
27+
public string ISO3Code { get; } = "GRD";
28+
29+
//<inheritdoc/>
30+
public string[] CallingCode { get; } = ["+1-473"];
31+
32+
//<inheritdoc/>
33+
public IEnumerable<State> States =>
34+
[
35+
new("Saint Andrew", "GD-01", "Parish"),
36+
new("Saint David", "GD-02", "Parish"),
37+
new("Saint George", "GD-03", "Parish"),
38+
new("Saint John", "GD-04", "Parish"),
39+
new("Saint Mark", "GD-05", "Parish"),
40+
new("Saint Patrick", "GD-06", "Parish"),
41+
new("Carriacou and Petite Martinique", "GD-10", "Dependency")
42+
];
43+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
namespace World.Net.Countries;
2+
3+
internal sealed class Guadeloupe : ICountry
4+
{
5+
//<inheritdoc/>
6+
public CountryIdentifier Id => CountryIdentifier.Guadeloupe;
7+
8+
//<inheritdoc/>
9+
public string Name { get; } = "Guadeloupe";
10+
11+
//<inheritdoc/>
12+
public string OfficialName { get; } = "Guadeloupe";
13+
14+
//<inheritdoc/>
15+
public string NativeName => "Guadeloupe";
16+
17+
//<inheritdoc/>
18+
public string Capital { get; } = "Basse-Terre";
19+
20+
//<inheritdoc/>
21+
public int NumericCode { get; } = 312;
22+
23+
//<inheritdoc/>
24+
public string ISO2Code { get; } = "GP";
25+
26+
//<inheritdoc/>
27+
public string ISO3Code { get; } = "GLP";
28+
29+
//<inheritdoc/>
30+
public string[] CallingCode { get; } = ["+590"];
31+
32+
//<inheritdoc/>
33+
public IEnumerable<State> States => [];
34+
}

0 commit comments

Comments
 (0)