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
52 changes: 52 additions & 0 deletions src/World.Net.UnitTests/Countries/OmanTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace World.Net.UnitTests.Countries;

public sealed class OmanTest : AssertCountryTestBase
{
private const string OMAN_COUNTRY_NAME = "Oman";
private const string OMAN_NATIVE_NAME = "عُمان";
private const string OMAN_CAPITAL = "Muscat";
private const string OMAN_OFFICIAL_NAME = "Sultanate of Oman";
private const string OMAN_ISO2_CODE = "OM";
private const string OMAN_ISO3_CODE = "OMN";
private const int OMAN_NUMERIC_CODE = 512;
private readonly string[] OMAN_CALLING_CODE = ["+968"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Oman;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Ad Dakhiliyah", "OM-DA", "Governorate"),
new("Ad Dhahirah", "OM-ZA", "Governorate"),
new("Al Batinah North", "OM-BN", "Governorate"),
new("Al Batinah South", "OM-BS", "Governorate"),
new("Al Wusta", "OM-WU", "Governorate"),
new("Ash Sharqiyah North", "OM-SH", "Governorate"),
new("Ash Sharqiyah South", "OM-SS", "Governorate"),
new("Dhofar", "OM-ZU", "Governorate"),
new("Muscat", "OM-MU", "Governorate"),
new("Musandam", "OM-MN", "Governorate"),
new("Al Buraimi", "OM-BR", "Governorate")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
OMAN_COUNTRY_NAME,
OMAN_OFFICIAL_NAME,
OMAN_NATIVE_NAME,
OMAN_CAPITAL,
OMAN_NUMERIC_CODE,
OMAN_ISO2_CODE,
OMAN_ISO3_CODE,
OMAN_CALLING_CODE,
EXPECTED_STATES
);
}
}
48 changes: 48 additions & 0 deletions src/World.Net.UnitTests/Countries/PakistanTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
namespace World.Net.UnitTests.Countries;

public sealed class PakistanTest : AssertCountryTestBase
{
private const string PAKISTAN_COUNTRY_NAME = "Pakistan";
private const string PAKISTAN_NATIVE_NAME = "پاکستان";
private const string PAKISTAN_CAPITAL = "Islamabad";
private const string PAKISTAN_OFFICIAL_NAME = "Islamic Republic of Pakistan";
private const string PAKISTAN_ISO2_CODE = "PK";
private const string PAKISTAN_ISO3_CODE = "PAK";
private const int PAKISTAN_NUMERIC_CODE = 586;
private readonly string[] PAKISTAN_CALLING_CODE = ["+92"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Pakistan;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Balochistan", "PK-BA", "Province"),
new("Khyber Pakhtunkhwa", "PK-KP", "Province"),
new("Punjab", "PK-PB", "Province"),
new("Sindh", "PK-SD", "Province"),
new("Gilgit-Baltistan", "PK-GB", "Autonomous Territory"),
new("Azad Jammu and Kashmir", "PK-AJ", "Autonomous Territory"),
new("Islamabad Capital Territory", "PK-IS", "Federal Territory")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PAKISTAN_COUNTRY_NAME,
PAKISTAN_OFFICIAL_NAME,
PAKISTAN_NATIVE_NAME,
PAKISTAN_CAPITAL,
PAKISTAN_NUMERIC_CODE,
PAKISTAN_ISO2_CODE,
PAKISTAN_ISO3_CODE,
PAKISTAN_CALLING_CODE,
EXPECTED_STATES
);
}
}
57 changes: 57 additions & 0 deletions src/World.Net.UnitTests/Countries/PalauTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace World.Net.UnitTests.Countries;

public sealed class PalauTest : AssertCountryTestBase
{
private const string PALAU_COUNTRY_NAME = "Palau";
private const string PALAU_NATIVE_NAME = "Belau";
private const string PALAU_CAPITAL = "Ngerulmud";
private const string PALAU_OFFICIAL_NAME = "Republic of Palau";
private const string PALAU_ISO2_CODE = "PW";
private const string PALAU_ISO3_CODE = "PLW";
private const int PALAU_NUMERIC_CODE = 585;
private readonly string[] PALAU_CALLING_CODE = ["+680"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Palau;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Aimeliik", "PW-002", "State"),
new("Airai", "PW-004", "State"),
new("Angaur", "PW-010", "State"),
new("Hatohobei", "PW-050", "State"),
new("Kayangel", "PW-100", "State"),
new("Koror", "PW-150", "State"),
new("Melekeok", "PW-212", "State"),
new("Ngaraard", "PW-214", "State"),
new("Ngarchelong", "PW-218", "State"),
new("Ngardmau", "PW-222", "State"),
new("Ngatpang", "PW-224", "State"),
new("Ngchesar", "PW-226", "State"),
new("Ngeremlengui", "PW-227", "State"),
new("Ngiwal", "PW-228", "State"),
new("Peleliu", "PW-350", "State"),
new("Sonsorol", "PW-370", "State")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PALAU_COUNTRY_NAME,
PALAU_OFFICIAL_NAME,
PALAU_NATIVE_NAME,
PALAU_CAPITAL,
PALAU_NUMERIC_CODE,
PALAU_ISO2_CODE,
PALAU_ISO3_CODE,
PALAU_CALLING_CODE,
EXPECTED_STATES
);
}
}
43 changes: 43 additions & 0 deletions src/World.Net.UnitTests/Countries/PalestineTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
namespace World.Net.UnitTests.Countries;

public sealed class PalestineTest : AssertCountryTestBase
{
private const string PALESTINE_COUNTRY_NAME = "Palestinian Territory, Occupied";
private const string PALESTINE_NATIVE_NAME = "دولة فلسطين";
private const string PALESTINE_CAPITAL = "Ramallah";
private const string PALESTINE_OFFICIAL_NAME = "State of Palestine";
private const string PALESTINE_ISO2_CODE = "PS";
private const string PALESTINE_ISO3_CODE = "PSE";
private const int PALESTINE_NUMERIC_CODE = 275;
private readonly string[] PALESTINE_CALLING_CODE = ["+970"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.PalestinianTerritoryOccupied;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Gaza", "PS-GA", "Governorate"),
new("West Bank", "PS-WB", "Governorate")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PALESTINE_COUNTRY_NAME,
PALESTINE_OFFICIAL_NAME,
PALESTINE_NATIVE_NAME,
PALESTINE_CAPITAL,
PALESTINE_NUMERIC_CODE,
PALESTINE_ISO2_CODE,
PALESTINE_ISO3_CODE,
PALESTINE_CALLING_CODE,
EXPECTED_STATES
);
}
}
60 changes: 60 additions & 0 deletions src/World.Net.UnitTests/Countries/PanamaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries;

public sealed class PanamaTest : AssertCountryTestBase
{
private const string PANAMA_COUNTRY_NAME = "Panama";
private const string PANAMA_NATIVE_NAME = "República de Panamá";
private const string PANAMA_CAPITAL = "Panama City";
private const string PANAMA_OFFICIAL_NAME = "Republic of Panama";
private const string PANAMA_ISO2_CODE = "PA";
private const string PANAMA_ISO3_CODE = "PAN";
private const int PANAMA_NUMERIC_CODE = 591;
private readonly string[] PANAMA_CALLING_CODE = ["+507"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Panama;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Bocas del Toro", "PA-1", "Province"),
new("Chiriquí", "PA-4", "Province"),
new("Coclé", "PA-2", "Province"),
new("Colón", "PA-3", "Province"),
new("Darién", "PA-5", "Province"),
new("Herrera", "PA-6", "Province"),
new("Los Santos", "PA-7", "Province"),
new("Panamá", "PA-8", "Province"),
new("Veraguas", "PA-9", "Province"),
new("Panamá Oeste", "PA-10", "Province"),
new("Kuna Yala", "PA-KY", "Indigenous Region"),
new("Ngäbe-Buglé", "PA-NB", "Indigenous Region"),
new("Emberá-Wounaan", "PA-EM", "Indigenous Region")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PANAMA_COUNTRY_NAME,
PANAMA_OFFICIAL_NAME,
PANAMA_NATIVE_NAME,
PANAMA_CAPITAL,
PANAMA_NUMERIC_CODE,
PANAMA_ISO2_CODE,
PANAMA_ISO3_CODE,
PANAMA_CALLING_CODE,
EXPECTED_STATES
);
}
}
63 changes: 63 additions & 0 deletions src/World.Net.UnitTests/Countries/PapuaNewGuineaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
namespace World.Net.UnitTests.Countries;

public sealed class PapuaNewGuineaTest : AssertCountryTestBase
{
private const string PNG_COUNTRY_NAME = "Papua New Guinea";
private const string PNG_NATIVE_NAME = "Papua Niugini";
private const string PNG_CAPITAL = "Port Moresby";
private const string PNG_OFFICIAL_NAME = "Independent State of Papua New Guinea";
private const string PNG_ISO2_CODE = "PG";
private const string PNG_ISO3_CODE = "PNG";
private const int PNG_NUMERIC_CODE = 598;
private readonly string[] PNG_CALLING_CODE = ["+675"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.PapuaNewGuinea;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Central", "PG-CN", "Province"),
new("Gulf", "PG-GL", "Province"),
new("Milne Bay", "PG-MB", "Province"),
new("Northern", "PG-NB", "Province"),
new("Southern Highlands", "PG-SH", "Province"),
new("Western", "PG-WP", "Province"),
new("Western Highlands", "PG-WH", "Province"),
new("Enga", "PG-EN", "Province"),
new("Eastern Highlands", "PG-EH", "Province"),
new("Hela", "PG-HE", "Province"),
new("Morobe", "PG-MO", "Province"),
new("Madang", "PG-MD", "Province"),
new("New Ireland", "PG-NI", "Province"),
new("East New Britain", "PG-EB", "Province"),
new("West New Britain", "PG-WB", "Province"),
new("Manus", "PG-MA", "Province"),
new("Bougainville", "PG-BA", "Autonomous Region"),
new("Chimbu", "PG-CP", "Province"),
new("Oro", "PG-OR", "Province"),
new("Sandaun", "PG-SO", "Province"),
new("Central", "PG-CE", "Province"),
new("National Capital District", "PG-NCD", "District")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PNG_COUNTRY_NAME,
PNG_OFFICIAL_NAME,
PNG_NATIVE_NAME,
PNG_CAPITAL,
PNG_NUMERIC_CODE,
PNG_ISO2_CODE,
PNG_ISO3_CODE,
PNG_CALLING_CODE,
EXPECTED_STATES
);
}
}
59 changes: 59 additions & 0 deletions src/World.Net.UnitTests/Countries/ParaguayTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
namespace World.Net.UnitTests.Countries;

public sealed class ParaguayTest : AssertCountryTestBase
{
private const string PARAGUAY_COUNTRY_NAME = "Paraguay";
private const string PARAGUAY_NATIVE_NAME = "República del Paraguay";
private const string PARAGUAY_CAPITAL = "Asunción";
private const string PARAGUAY_OFFICIAL_NAME = "Republic of Paraguay";
private const string PARAGUAY_ISO2_CODE = "PY";
private const string PARAGUAY_ISO3_CODE = "PRY";
private const int PARAGUAY_NUMERIC_CODE = 600;
private readonly string[] PARAGUAY_CALLING_CODE = ["+595"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Paraguay;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Alto Paraguay", "PY-16", "Department"),
new("Alto Paraná", "PY-10", "Department"),
new("Amambay", "PY-13", "Department"),
new("Asunción", "PY-ASU", "Capital District"),
new("Boquerón", "PY-19", "Department"),
new("Caaguazú", "PY-5", "Department"),
new("Caazapá", "PY-6", "Department"),
new("Canindeyú", "PY-11", "Department"),
new("Central", "PY-15", "Department"),
new("Concepción", "PY-1", "Department"),
new("Cordillera", "PY-3", "Department"),
new("Guairá", "PY-4", "Department"),
new("Itapúa", "PY-7", "Department"),
new("Misiones", "PY-8", "Department"),
new("Ñeembucú", "PY-12", "Department"),
new("Paraguarí", "PY-9", "Department"),
new("Presidente Hayes", "PY-17", "Department"),
new("San Pedro", "PY-2", "Department")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
PARAGUAY_COUNTRY_NAME,
PARAGUAY_OFFICIAL_NAME,
PARAGUAY_NATIVE_NAME,
PARAGUAY_CAPITAL,
PARAGUAY_NUMERIC_CODE,
PARAGUAY_ISO2_CODE,
PARAGUAY_ISO3_CODE,
PARAGUAY_CALLING_CODE,
EXPECTED_STATES
);
}
}
Loading