Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/World.Net.UnitTests/Countries/GuineaBissauTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace World.Net.UnitTests.Countries;

public sealed class GuineaBissauTest : AssertCountryTestBase
{
private const string GUINEABISSAU_COUNTRY_NAME = "Guinea-Bissau";
private const string GUINEABISSAU_NATIVE_NAME = "Guiné-Bissau";
private const string GUINEABISSAU_CAPITAL = "Bissau";
private const string GUINEABISSAU_OFFICIAL_NAME = "Republic of Guinea-Bissau";
private const string GUINEABISSAU_ISO2_CODE = "GW";
private const string GUINEABISSAU_ISO3_CODE = "GNB";
private const int GUINEABISSAU_NUMERIC_CODE = 624;
private readonly string[] GUINEABISSAU_CALLING_CODE = ["+245"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.GuineaBissau;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Bafatá", "GW-BFA", "Region"),
new("Biombo", "GW-BIB", "Region"),
new("Bissau", "GW-BS", "Region"),
new("Bolama", "GW-BM", "Region"),
new("Cacheu", "GW-CA", "Region"),
new("Gabu", "GW-GA", "Region"),
new("Oio", "GW-OI", "Region"),
new("Quinara", "GW-QU", "Region"),
new("Tombali", "GW-TO", "Region")
];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForGuineaBissau()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
GUINEABISSAU_COUNTRY_NAME,
GUINEABISSAU_OFFICIAL_NAME,
GUINEABISSAU_NATIVE_NAME,
GUINEABISSAU_CAPITAL,
GUINEABISSAU_NUMERIC_CODE,
GUINEABISSAU_ISO2_CODE,
GUINEABISSAU_ISO3_CODE,
GUINEABISSAU_CALLING_CODE,
EXPECTED_STATES
);
}
}

51 changes: 51 additions & 0 deletions src/World.Net.UnitTests/Countries/GuyanaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace World.Net.UnitTests.Countries;

public sealed class GuyanaTest : AssertCountryTestBase
{
private const string GUYANA_COUNTRY_NAME = "Guyana";
private const string GUYANA_NATIVE_NAME = "Guyana";
private const string GUYANA_CAPITAL = "Georgetown";
private const string GUYANA_OFFICIAL_NAME = "Co-operative Republic of Guyana";
private const string GUYANA_ISO2_CODE = "GY";
private const string GUYANA_ISO3_CODE = "GUY";
private const int GUYANA_NUMERIC_CODE = 328;
private readonly string[] GUYANA_CALLING_CODE = ["+592"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Guyana;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Barima-Waini", "GY-BA", "Region"),
new("Pomeroon-Supenaam", "GY-PT", "Region"),
new("Essequibo Islands-West Demerara", "GY-ES", "Region"),
new("Demerara-Mahaica", "GY-DE", "Region"),
new("Mahaica-Berbice", "GY-MA", "Region"),
new("East Berbice-Corentyne", "GY-EB", "Region"),
new("Cuyuni-Mazaruni", "GY-CU", "Region"),
new("Potaro-Siparuni", "GY-PT", "Region"),
new("Upper Takutu-Upper Essequibo", "GY-UT", "Region"),
new("Upper Demerara-Berbice", "GY-UD", "Region")
];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForGuyana()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
GUYANA_COUNTRY_NAME,
GUYANA_OFFICIAL_NAME,
GUYANA_NATIVE_NAME,
GUYANA_CAPITAL,
GUYANA_NUMERIC_CODE,
GUYANA_ISO2_CODE,
GUYANA_ISO3_CODE,
GUYANA_CALLING_CODE,
EXPECTED_STATES
);
}
}
51 changes: 51 additions & 0 deletions src/World.Net.UnitTests/Countries/HaitiTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace World.Net.UnitTests.Countries;

public sealed class HaitiTest : AssertCountryTestBase
{
private const string HAITI_COUNTRY_NAME = "Haiti";
private const string HAITI_NATIVE_NAME = "Haïti";
private const string HAITI_CAPITAL = "Port-au-Prince";
private const string HAITI_OFFICIAL_NAME = "Republic of Haiti";
private const string HAITI_ISO2_CODE = "HT";
private const string HAITI_ISO3_CODE = "HTI";
private const int HAITI_NUMERIC_CODE = 332;
private readonly string[] HAITI_CALLING_CODE = ["+509"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Haiti;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Artibonite", "HT-AR", "Department"),
new("Centre", "HT-CE", "Department"),
new("Grand'Anse", "HT-GA", "Department"),
new("Nippes", "HT-NI", "Department"),
new("Nord", "HT-NO", "Department"),
new("Nord-Est", "HT-NE", "Department"),
new("Nord-Ouest", "HT-NW", "Department"),
new("Ouest", "HT-OU", "Department"),
new("Sud", "HT-SD", "Department"),
new("Sud-Est", "HT-SE", "Department")
];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForHaiti()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
HAITI_COUNTRY_NAME,
HAITI_OFFICIAL_NAME,
HAITI_NATIVE_NAME,
HAITI_CAPITAL,
HAITI_NUMERIC_CODE,
HAITI_ISO2_CODE,
HAITI_ISO3_CODE,
HAITI_CALLING_CODE,
EXPECTED_STATES
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace World.Net.UnitTests.Countries;

public sealed class HeardIslandAndMcDonaldIslandsTest : AssertCountryTestBase
{
private const string COUNTRY_NAME = "Heard Island and McDonald Islands";
private const string NATIVE_NAME = "Heard Island and McDonald Islands";
private const string CAPITAL = "Atlas Cove";
private const string OFFICIAL_NAME = "Heard Island and McDonald Islands";
private const string ISO2_CODE = "HM";
private const string ISO3_CODE = "HMD";
private const int NUMERIC_CODE = 334;
private readonly string[] CALLING_CODE = []; // No calling code
private const CountryIdentifier EXPECTEDID = CountryIdentifier.HeardIslandAndMcDonaldIslands;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForHeardIslandAndMcDonaldIslands()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
COUNTRY_NAME,
OFFICIAL_NAME,
NATIVE_NAME,
CAPITAL,
NUMERIC_CODE,
ISO2_CODE,
ISO3_CODE,
CALLING_CODE,
EXPECTED_STATES
);
}
}
59 changes: 59 additions & 0 deletions src/World.Net.UnitTests/Countries/HondurasTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
namespace World.Net.UnitTests.Countries;

public sealed class HondurasTest : AssertCountryTestBase
{
private const string HONDURAS_COUNTRY_NAME = "Honduras";
private const string HONDURAS_NATIVE_NAME = "Honduras";
private const string HONDURAS_CAPITAL = "Tegucigalpa";
private const string HONDURAS_OFFICIAL_NAME = "Republic of Honduras";
private const string HONDURAS_ISO2_CODE = "HN";
private const string HONDURAS_ISO3_CODE = "HND";
private const int HONDURAS_NUMERIC_CODE = 340;
private readonly string[] HONDURAS_CALLING_CODE = ["+504"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Honduras;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Atlántida", "HN-AT", "Department"),
new("Choluteca", "HN-CH", "Department"),
new("Colón", "HN-CL", "Department"),
new("Comayagua", "HN-CM", "Department"),
new("Copán", "HN-CP", "Department"),
new("Cortés", "HN-CR", "Department"),
new("El Paraíso", "HN-EP", "Department"),
new("Francisco Morazán", "HN-FM", "Department"),
new("Gracias a Dios", "HN-GD", "Department"),
new("Intibucá", "HN-IN", "Department"),
new("Islas de la Bahía", "HN-IB", "Department"),
new("La Paz", "HN-LP", "Department"),
new("Lempira", "HN-LE", "Department"),
new("Ocotepeque", "HN-OC", "Department"),
new("Olancho", "HN-OL", "Department"),
new("Santa Bárbara", "HN-SB", "Department"),
new("Valle", "HN-VA", "Department"),
new("Yoro", "HN-YO", "Department")
];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForHonduras()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
HONDURAS_COUNTRY_NAME,
HONDURAS_OFFICIAL_NAME,
HONDURAS_NATIVE_NAME,
HONDURAS_CAPITAL,
HONDURAS_NUMERIC_CODE,
HONDURAS_ISO2_CODE,
HONDURAS_ISO3_CODE,
HONDURAS_CALLING_CODE,
EXPECTED_STATES
);
}
}
39 changes: 39 additions & 0 deletions src/World.Net.UnitTests/Countries/HongKongTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace World.Net.UnitTests.Countries;

public sealed class HongKongTest : AssertCountryTestBase
{
private const string COUNTRY_NAME = "Hong Kong";
private const string NATIVE_NAME = "香港";
private const string CAPITAL = "Hong Kong";
private const string OFFICIAL_NAME = "Hong Kong Special Administrative Region of China";
private const string ISO2_CODE = "HK";
private const string ISO3_CODE = "HKG";
private const int NUMERIC_CODE = 344;
private readonly string[] CALLING_CODE = ["+852"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.HongKongSAR;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES = [];

[Fact]
public void GetCountry_ReturnsCorrectInformation_ForHongKong()
{
// Arrange
// Act
var country = CountryProvider.GetCountry(EXPECTEDID);

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
COUNTRY_NAME,
OFFICIAL_NAME,
NATIVE_NAME,
CAPITAL,
NUMERIC_CODE,
ISO2_CODE,
ISO3_CODE,
CALLING_CODE,
EXPECTED_STATES
);
}
}
45 changes: 45 additions & 0 deletions src/World.Net/Countries/GuineaBissau.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
namespace World.Net.Countries;

internal sealed class GuineaBissau : ICountry
{
//<inheritdoc/>
public CountryIdentifier Id => CountryIdentifier.GuineaBissau;

//<inheritdoc/>
public string Name { get; } = "Guinea-Bissau";

//<inheritdoc/>
public string OfficialName { get; } = "Republic of Guinea-Bissau";

//<inheritdoc/>
public string NativeName => "Guiné-Bissau";

//<inheritdoc/>
public string Capital { get; } = "Bissau";

//<inheritdoc/>
public int NumericCode { get; } = 624;

//<inheritdoc/>
public string ISO2Code { get; } = "GW";

//<inheritdoc/>
public string ISO3Code { get; } = "GNB";

//<inheritdoc/>
public string[] CallingCode { get; } = ["+245"];

//<inheritdoc/>
public IEnumerable<State> States =>
[
new("Bafatá", "GW-BFA", "Region"),
new("Biombo", "GW-BIB", "Region"),
new("Bissau", "GW-BS", "Region"), // autonomous sector
new("Bolama", "GW-BM", "Region"),
new("Cacheu", "GW-CA", "Region"),
new("Gabu", "GW-GA", "Region"),
new("Oio", "GW-OI", "Region"),
new("Quinara", "GW-QU", "Region"),
new("Tombali", "GW-TO", "Region")
];
}
46 changes: 46 additions & 0 deletions src/World.Net/Countries/Guyana.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace World.Net.Countries;

internal sealed class Guyana : ICountry
{
//<inheritdoc/>
public CountryIdentifier Id => CountryIdentifier.Guyana;

//<inheritdoc/>
public string Name { get; } = "Guyana";

//<inheritdoc/>
public string OfficialName { get; } = "Co-operative Republic of Guyana";

//<inheritdoc/>
public string NativeName => "Guyana";

//<inheritdoc/>
public string Capital { get; } = "Georgetown";

//<inheritdoc/>
public int NumericCode { get; } = 328;

//<inheritdoc/>
public string ISO2Code { get; } = "GY";

//<inheritdoc/>
public string ISO3Code { get; } = "GUY";

//<inheritdoc/>
public string[] CallingCode { get; } = ["+592"];

//<inheritdoc/>
public IEnumerable<State> States =>
[
new("Barima-Waini", "GY-BA", "Region"),
new("Pomeroon-Supenaam", "GY-PT", "Region"),
new("Essequibo Islands-West Demerara", "GY-ES", "Region"),
new("Demerara-Mahaica", "GY-DE", "Region"),
new("Mahaica-Berbice", "GY-MA", "Region"),
new("East Berbice-Corentyne", "GY-EB", "Region"),
new("Cuyuni-Mazaruni", "GY-CU", "Region"),
new("Potaro-Siparuni", "GY-PT", "Region"),
new("Upper Takutu-Upper Essequibo", "GY-UT", "Region"),
new("Upper Demerara-Berbice", "GY-UD", "Region")
];
}
Loading