Skip to content

Commit 19b1de7

Browse files
Reagan ReubenReagan Reuben
authored andcommitted
resolve conflicts
2 parents 3b5e6ca + 296f33f commit 19b1de7

21 files changed

Lines changed: 882 additions & 1 deletion
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
namespace World.Net.UnitTests.Countries
2+
{
3+
public sealed class CaymanIslandsTest
4+
{
5+
private const string CAYMAN_ISLANDS_COUNTRY_NAME = "Cayman Islands";
6+
private const string CAYMAN_ISLANDS_NATIVE_NAME = "Cayman Islands";
7+
private const string CAYMAN_ISLANDS_CAPITAL = "George Town";
8+
private const string CAYMAN_ISLANDS_OFFICIAL_NAME = "Cayman Islands";
9+
private const string CAYMAN_ISLANDS_ISO2_CODE = "KY";
10+
private const string CAYMAN_ISLANDS_ISO3_CODE = "CYM";
11+
private const int CAYMAN_ISLANDS_NUMERIC_CODE = 136;
12+
private const string CAYMAN_ISLANDS_CALLING_CODE = "+1-345";
13+
private const int CAYMAN_ISLANDS_STATE_COUNT = 3;
14+
private static readonly string[] VALID_STATE_TYPES = { "District" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCaymanIslands()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.CaymanIslands;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CAYMAN_ISLANDS_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CAYMAN_ISLANDS_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CAYMAN_ISLANDS_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CAYMAN_ISLANDS_CAPITAL, country.Capital);
32+
Assert.Equal(CAYMAN_ISLANDS_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CAYMAN_ISLANDS_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CAYMAN_ISLANDS_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CAYMAN_ISLANDS_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CAYMAN_ISLANDS_STATE_COUNT, country.States.Count());
38+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
39+
}
40+
}
41+
}
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 CentralAfricanRepublicTest
4+
{
5+
private const string CAR_COUNTRY_NAME = "Central African Republic";
6+
private const string CAR_NATIVE_NAME = "Ködörösêse tî Bêafrîka";
7+
private const string CAR_CAPITAL = "Bangui";
8+
private const string CAR_OFFICIAL_NAME = "Central African Republic";
9+
private const string CAR_ISO2_CODE = "CF";
10+
private const string CAR_ISO3_CODE = "CAF";
11+
private const int CAR_NUMERIC_CODE = 140;
12+
private const string CAR_CALLING_CODE = "+236";
13+
private const int CAR_STATE_COUNT = 14;
14+
private static readonly string[] VALID_STATE_TYPES = { "Prefecture", "Capital District" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCentralAfricanRepublic()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.CentralAfricanRepublic;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CAR_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CAR_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CAR_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CAR_CAPITAL, country.Capital);
32+
Assert.Equal(CAR_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CAR_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CAR_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CAR_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CAR_STATE_COUNT, country.States.Count());
38+
39+
// Assert that each state has a valid type
40+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
41+
}
42+
}
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 ChadTest
4+
{
5+
private const string CHAD_COUNTRY_NAME = "Chad";
6+
private const string CHAD_NATIVE_NAME = "Tchad";
7+
private const string CHAD_CAPITAL = "N'Djamena";
8+
private const string CHAD_OFFICIAL_NAME = "Republic of Chad";
9+
private const string CHAD_ISO2_CODE = "TD";
10+
private const string CHAD_ISO3_CODE = "TCD";
11+
private const int CHAD_NUMERIC_CODE = 148;
12+
private const string CHAD_CALLING_CODE = "+235";
13+
private const int CHAD_STATE_COUNT = 23;
14+
private static readonly string[] VALID_STATE_TYPES = { "Region" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForChad()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Chad;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CHAD_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CHAD_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CHAD_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CHAD_CAPITAL, country.Capital);
32+
Assert.Equal(CHAD_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CHAD_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CHAD_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CHAD_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CHAD_STATE_COUNT, country.States.Count());
38+
39+
// Assert that each state has a valid type
40+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
41+
}
42+
}
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 ChileTest
4+
{
5+
private const string CHILE_COUNTRY_NAME = "Chile";
6+
private const string CHILE_NATIVE_NAME = "República de Chile";
7+
private const string CHILE_CAPITAL = "Santiago";
8+
private const string CHILE_OFFICIAL_NAME = "Republic of Chile";
9+
private const string CHILE_ISO2_CODE = "CL";
10+
private const string CHILE_ISO3_CODE = "CHL";
11+
private const int CHILE_NUMERIC_CODE = 152;
12+
private const string CHILE_CALLING_CODE = "+56";
13+
private const int CHILE_STATE_COUNT = 16;
14+
private static readonly string[] VALID_STATE_TYPES = { "Region" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForChile()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Chile;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CHILE_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CHILE_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CHILE_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CHILE_CAPITAL, country.Capital);
32+
Assert.Equal(CHILE_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CHILE_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CHILE_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CHILE_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CHILE_STATE_COUNT, country.States.Count());
38+
39+
// Assert that each state has a valid type
40+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
41+
}
42+
}
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 ChinaTest
4+
{
5+
private const string CHINA_COUNTRY_NAME = "China";
6+
private const string CHINA_NATIVE_NAME = "中国";
7+
private const string CHINA_CAPITAL = "Beijing";
8+
private const string CHINA_OFFICIAL_NAME = "People's Republic of China";
9+
private const string CHINA_ISO2_CODE = "CN";
10+
private const string CHINA_ISO3_CODE = "CHN";
11+
private const int CHINA_NUMERIC_CODE = 156;
12+
private const string CHINA_CALLING_CODE = "+86";
13+
private const int CHINA_STATE_COUNT = 34; // 23 Provinces, 4 Municipalities, 5 Autonomous Regions, 2 SAR
14+
private static readonly string[] VALID_STATE_TYPES = { "Province", "Municipality", "Autonomous Region", "Special Administrative Region" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForChina()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.China;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CHINA_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CHINA_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CHINA_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CHINA_CAPITAL, country.Capital);
32+
Assert.Equal(CHINA_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CHINA_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CHINA_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CHINA_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CHINA_STATE_COUNT, country.States.Count());
38+
39+
// Assert that each state has a valid type
40+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
41+
}
42+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class CroatiaTest
4+
{
5+
private const string CROATIA_COUNTRY_NAME = "Croatia";
6+
private const string CROATIA_NATIVE_NAME = "Hrvatska";
7+
private const string CROATIA_CAPITAL = "Zagreb";
8+
private const string CROATIA_OFFICIAL_NAME = "Republic of Croatia";
9+
private const string CROATIA_ISO2_CODE = "HR";
10+
private const string CROATIA_ISO3_CODE = "HRV";
11+
private const int CROATIA_NUMERIC_CODE = 191;
12+
private const string CROATIA_CALLING_CODE = "+385";
13+
private const int CROATIA_STATE_COUNT = 21;
14+
private static readonly string[] VALID_STATE_TYPES = { "City", "County" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCroatia()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Croatia;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CROATIA_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CROATIA_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CROATIA_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CROATIA_CAPITAL, country.Capital);
32+
Assert.Equal(CROATIA_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CROATIA_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CROATIA_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CROATIA_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CROATIA_STATE_COUNT, country.States.Count());
38+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class CubaTest
4+
{
5+
private const string CUBA_COUNTRY_NAME = "Cuba";
6+
private const string CUBA_NATIVE_NAME = "Cuba";
7+
private const string CUBA_CAPITAL = "Havana";
8+
private const string CUBA_OFFICIAL_NAME = "Republic of Cuba";
9+
private const string CUBA_ISO2_CODE = "CU";
10+
private const string CUBA_ISO3_CODE = "CUB";
11+
private const int CUBA_NUMERIC_CODE = 192;
12+
private const string CUBA_CALLING_CODE = "+53";
13+
private const int CUBA_STATE_COUNT = 16;
14+
private static readonly string[] VALID_STATE_TYPES = { "Province", "Special Municipality" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCuba()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Cuba;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CUBA_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CUBA_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CUBA_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CUBA_CAPITAL, country.Capital);
32+
Assert.Equal(CUBA_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CUBA_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CUBA_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CUBA_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CUBA_STATE_COUNT, country.States.Count());
38+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class CuraçaoTest
4+
{
5+
private const string CURACAO_COUNTRY_NAME = "Curaçao";
6+
private const string CURACAO_NATIVE_NAME = "Kòrsou";
7+
private const string CURACAO_CAPITAL = "Willemstad";
8+
private const string CURACAO_OFFICIAL_NAME = "Country of Curaçao";
9+
private const string CURACAO_ISO2_CODE = "CW";
10+
private const string CURACAO_ISO3_CODE = "CUW";
11+
private const int CURACAO_NUMERIC_CODE = 531;
12+
private const string CURACAO_CALLING_CODE = "+599";
13+
private const int CURACAO_STATE_COUNT = 1;
14+
private static readonly string[] VALID_STATE_TYPES = { "Country" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCuracao()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Curacao;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CURACAO_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CURACAO_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CURACAO_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CURACAO_CAPITAL, country.Capital);
32+
Assert.Equal(CURACAO_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CURACAO_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CURACAO_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CURACAO_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.NotEmpty(country.States);
38+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
namespace World.Net.UnitTests.Countries;
2+
3+
public sealed class CyprusTest
4+
{
5+
private const string CYPRUS_COUNTRY_NAME = "Cyprus";
6+
private const string CYPRUS_NATIVE_NAME = "Κύπρος";
7+
private const string CYPRUS_CAPITAL = "Nicosia";
8+
private const string CYPRUS_OFFICIAL_NAME = "Republic of Cyprus";
9+
private const string CYPRUS_ISO2_CODE = "CY";
10+
private const string CYPRUS_ISO3_CODE = "CYP";
11+
private const int CYPRUS_NUMERIC_CODE = 196;
12+
private const string CYPRUS_CALLING_CODE = "+357";
13+
private const int CYPRUS_STATE_COUNT = 6;
14+
private static readonly string[] VALID_STATE_TYPES = { "District" };
15+
16+
[Fact]
17+
public void GetCountry_ReturnsCorrectInformation_ForCyprus()
18+
{
19+
// Arrange
20+
CountryIdentifier existingCountryId = CountryIdentifier.Cyprus;
21+
22+
// Act
23+
var country = CountryProvider.GetCountry(existingCountryId);
24+
25+
// Assert
26+
Assert.NotNull(country);
27+
Assert.Equal(existingCountryId, country.Id);
28+
Assert.Equal(CYPRUS_COUNTRY_NAME, country.Name);
29+
Assert.Equal(CYPRUS_OFFICIAL_NAME, country.OfficialName);
30+
Assert.Equal(CYPRUS_NATIVE_NAME, country.NativeName);
31+
Assert.Equal(CYPRUS_CAPITAL, country.Capital);
32+
Assert.Equal(CYPRUS_NUMERIC_CODE, country.NumericCode);
33+
Assert.Equal(CYPRUS_ISO2_CODE, country.ISO2Code);
34+
Assert.Equal(CYPRUS_ISO3_CODE, country.ISO3Code);
35+
Assert.Equal(CYPRUS_CALLING_CODE, country.CallingCode);
36+
Assert.NotNull(country.States);
37+
Assert.Equal(CYPRUS_STATE_COUNT, country.States.Count());
38+
Assert.All(country.States, state => Assert.Contains(state.Type, VALID_STATE_TYPES));
39+
}
40+
}

0 commit comments

Comments
 (0)