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

public sealed class NigeriaTest : AssertCountryTestBase
{
private const string NIGERIA_COUNTRY_NAME = "Nigeria";
private const string NIGERIA_NATIVE_NAME = "Nigeria";
private const string NIGERIA_CAPITAL = "Abuja";
private const string NIGERIA_OFFICIAL_NAME = "Federal Republic of Nigeria";
private const string NIGERIA_ISO2_CODE = "NG";
private const string NIGERIA_ISO3_CODE = "NGA";
private const int NIGERIA_NUMERIC_CODE = 566;
private readonly string[] NIGERIA_CALLING_CODE = ["+234"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Nigeria;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Abia", "NG-AB", "State"),
new("Adamawa", "NG-AD", "State"),
new("Akwa Ibom", "NG-AK", "State"),
new("Anambra", "NG-AN", "State"),
new("Bauchi", "NG-BA", "State"),
new("Bayelsa", "NG-BY", "State"),
new("Benue", "NG-BE", "State"),
new("Borno", "NG-BO", "State"),
new("Cross River", "NG-CR", "State"),
new("Delta", "NG-DE", "State"),
new("Ebonyi", "NG-EB", "State"),
new("Edo", "NG-ED", "State"),
new("Ekiti", "NG-EK", "State"),
new("Enugu", "NG-EN", "State"),
new("Gombe", "NG-GO", "State"),
new("Imo", "NG-IM", "State"),
new("Jigawa", "NG-JI", "State"),
new("Kaduna", "NG-KD", "State"),
new("Kano", "NG-KN", "State"),
new("Katsina", "NG-KT", "State"),
new("Kebbi", "NG-KE", "State"),
new("Kogi", "NG-KO", "State"),
new("Kwara", "NG-KW", "State"),
new("Lagos", "NG-LA", "State"),
new("Nasarawa", "NG-NA", "State"),
new("Niger", "NG-NI", "State"),
new("Ogun", "NG-OG", "State"),
new("Ondo", "NG-ON", "State"),
new("Osun", "NG-OS", "State"),
new("Oyo", "NG-OY", "State"),
new("Plateau", "NG-PL", "State"),
new("Rivers", "NG-RI", "State"),
new("Sokoto", "NG-SO", "State"),
new("Taraba", "NG-TA", "State"),
new("Yobe", "NG-YO", "State"),
new("Zamfara", "NG-ZA", "State"),
new("Federal Capital Territory", "NG-FC", "Federal Capital Territory")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NIGERIA_COUNTRY_NAME,
NIGERIA_OFFICIAL_NAME,
NIGERIA_NATIVE_NAME,
NIGERIA_CAPITAL,
NIGERIA_NUMERIC_CODE,
NIGERIA_ISO2_CODE,
NIGERIA_ISO3_CODE,
NIGERIA_CALLING_CODE,
EXPECTED_STATES
);
}
}
56 changes: 56 additions & 0 deletions src/World.Net.UnitTests/Countries/NiueTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
namespace World.Net.UnitTests.Countries;

public sealed class NiueTest : AssertCountryTestBase
{
private const string NIUE_COUNTRY_NAME = "Niue";
private const string NIUE_NATIVE_NAME = "Niuē";
private const string NIUE_CAPITAL = "Alofi";
private const string NIUE_OFFICIAL_NAME = "Niue";
private const string NIUE_ISO2_CODE = "NU";
private const string NIUE_ISO3_CODE = "NIU";
private const int NIUE_NUMERIC_CODE = 570;
private readonly string[] NIUE_CALLING_CODE = ["+683"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Niue;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Alofi North", "NU-01", "Village"),
new("Alofi South", "NU-02", "Village"),
new("Avatele", "NU-03", "Village"),
new("Hakupu", "NU-04", "Village"),
new("Hikutavake", "NU-05", "Village"),
new("Lakepa", "NU-06", "Village"),
new("Liku", "NU-07", "Village"),
new("Makefu", "NU-08", "Village"),
new("Mutalau", "NU-09", "Village"),
new("Namukulu", "NU-10", "Village"),
new("Talava", "NU-11", "Village"),
new("Toi", "NU-12", "Village"),
new("Tufukia", "NU-13", "Village"),
new("Vaiea", "NU-14", "Village")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NIUE_COUNTRY_NAME,
NIUE_OFFICIAL_NAME,
NIUE_NATIVE_NAME,
NIUE_CAPITAL,
NIUE_NUMERIC_CODE,
NIUE_ISO2_CODE,
NIUE_ISO3_CODE,
NIUE_CALLING_CODE,
EXPECTED_STATES
);
}
}

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

public sealed class NorfolkIslandTest : AssertCountryTestBase
{
private const string NORFOLK_ISLAND_COUNTRY_NAME = "Norfolk Island";
private const string NORFOLK_ISLAND_NATIVE_NAME = "Norfolk Island";
private const string NORFOLK_ISLAND_CAPITAL = "Kingston";
private const string NORFOLK_ISLAND_OFFICIAL_NAME = "Territory of Norfolk Island";
private const string NORFOLK_ISLAND_ISO2_CODE = "NF";
private const string NORFOLK_ISLAND_ISO3_CODE = "NFK";
private const int NORFOLK_ISLAND_NUMERIC_CODE = 574;
private readonly string[] NORFOLK_ISLAND_CALLING_CODE = ["+672"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorfolkIsland;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Anson Bay", "NF-01", "Settlement"),
new("Ball Bay", "NF-02", "Settlement"),
new("Bicentennial", "NF-03", "Settlement"),
new("Burnt Pine", "NF-04", "Settlement"),
new("Cascade", "NF-05", "Settlement"),
new("Kingston", "NF-06", "Settlement"),
new("Longridge", "NF-07", "Settlement"),
new("Mount Pitt", "NF-08", "Settlement"),
new("Queen Elizabeth", "NF-09", "Settlement"),
new("Royal", "NF-10", "Settlement"),
new("Suffolk", "NF-11", "Settlement")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NORFOLK_ISLAND_COUNTRY_NAME,
NORFOLK_ISLAND_OFFICIAL_NAME,
NORFOLK_ISLAND_NATIVE_NAME,
NORFOLK_ISLAND_CAPITAL,
NORFOLK_ISLAND_NUMERIC_CODE,
NORFOLK_ISLAND_ISO2_CODE,
NORFOLK_ISLAND_ISO3_CODE,
NORFOLK_ISLAND_CALLING_CODE,
EXPECTED_STATES
);
}
}

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

public sealed class NorthKoreaTest : AssertCountryTestBase
{
private const string NORTH_KOREA_COUNTRY_NAME = "North Korea";
private const string NORTH_KOREA_NATIVE_NAME = "조선민주주의인민공화국";
private const string NORTH_KOREA_CAPITAL = "Pyongyang";
private const string NORTH_KOREA_OFFICIAL_NAME = "Democratic People's Republic of Korea";
private const string NORTH_KOREA_ISO2_CODE = "KP";
private const string NORTH_KOREA_ISO3_CODE = "PRK";
private const int NORTH_KOREA_NUMERIC_CODE = 408;
private readonly string[] NORTH_KOREA_CALLING_CODE = ["+850"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthKorea;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Chagang", "KP-CHA", "Province"),
new("North Hamgyong", "KP-HAMN", "Province"),
new("South Hamgyong", "KP-HAMS", "Province"),
new("North Hwanghae", "KP-HWAN", "Province"),
new("South Hwanghae", "KP-HWAS", "Province"),
new("Kangwon", "KP-KAN", "Province"),
new("North Pyongan", "KP-PYON", "Province"),
new("South Pyongan", "KP-PYOS", "Province"),
new("Ryanggang", "KP-RYA", "Province"),
new("Kaesong", "KP-KA", "Special City"),
new("Nampo", "KP-NAM", "Special City"),
new("Pyongyang", "KP-PY", "Directly Governed City"),
new("Rason", "KP-RAS", "Directly Governed City"),
new("Sinuiju", "KP-SIN", "Special City")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NORTH_KOREA_COUNTRY_NAME,
NORTH_KOREA_OFFICIAL_NAME,
NORTH_KOREA_NATIVE_NAME,
NORTH_KOREA_CAPITAL,
NORTH_KOREA_NUMERIC_CODE,
NORTH_KOREA_ISO2_CODE,
NORTH_KOREA_ISO3_CODE,
NORTH_KOREA_CALLING_CODE,
EXPECTED_STATES
);
}
}
49 changes: 49 additions & 0 deletions src/World.Net.UnitTests/Countries/NorthMacedoniaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace World.Net.UnitTests.Countries;

public sealed class NorthMacedoniaTest : AssertCountryTestBase
{
private const string NORTH_MACEDONIA_COUNTRY_NAME = "North Macedonia";
private const string NORTH_MACEDONIA_NATIVE_NAME = "Северна Македонија";
private const string NORTH_MACEDONIA_CAPITAL = "Skopje";
private const string NORTH_MACEDONIA_OFFICIAL_NAME = "Republic of North Macedonia";
private const string NORTH_MACEDONIA_ISO2_CODE = "MK";
private const string NORTH_MACEDONIA_ISO3_CODE = "MKD";
private const int NORTH_MACEDONIA_NUMERIC_CODE = 807;
private readonly string[] NORTH_MACEDONIA_CALLING_CODE = ["+389"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthMacedonia;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Eastern", "MK-01", "Region"),
new("North Eastern", "MK-02", "Region"),
new("Skopje", "MK-03", "Region"),
new("Pelagonia", "MK-04", "Region"),
new("Polog", "MK-05", "Region"),
new("South Eastern", "MK-06", "Region"),
new("South Western", "MK-07", "Region"),
new("Vardar", "MK-08", "Region")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NORTH_MACEDONIA_COUNTRY_NAME,
NORTH_MACEDONIA_OFFICIAL_NAME,
NORTH_MACEDONIA_NATIVE_NAME,
NORTH_MACEDONIA_CAPITAL,
NORTH_MACEDONIA_NUMERIC_CODE,
NORTH_MACEDONIA_ISO2_CODE,
NORTH_MACEDONIA_ISO3_CODE,
NORTH_MACEDONIA_CALLING_CODE,
EXPECTED_STATES
);
}
}
45 changes: 45 additions & 0 deletions src/World.Net.UnitTests/Countries/NorthernMarianaIslandsTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
namespace World.Net.UnitTests.Countries;

public sealed class NorthernMarianaIslandsTest : AssertCountryTestBase
{
private const string NORTHERN_MARIANA_ISLANDS_COUNTRY_NAME = "Northern Mariana Islands";
private const string NORTHERN_MARIANA_ISLANDS_NATIVE_NAME = "Northern Mariana Islands";
private const string NORTHERN_MARIANA_ISLANDS_CAPITAL = "Saipan";
private const string NORTHERN_MARIANA_ISLANDS_OFFICIAL_NAME = "Commonwealth of the Northern Mariana Islands";
private const string NORTHERN_MARIANA_ISLANDS_ISO2_CODE = "MP";
private const string NORTHERN_MARIANA_ISLANDS_ISO3_CODE = "MNP";
private const int NORTHERN_MARIANA_ISLANDS_NUMERIC_CODE = 580;
private readonly string[] NORTHERN_MARIANA_ISLANDS_CALLING_CODE = ["+1-670"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.NorthernMarianaIslands;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Saipan", "MP-SA", "Municipality"),
new("Tinian", "MP-TI", "Municipality"),
new("Rota", "MP-RO", "Municipality"),
new("Northern Islands", "MP-NI", "Municipality")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NORTHERN_MARIANA_ISLANDS_COUNTRY_NAME,
NORTHERN_MARIANA_ISLANDS_OFFICIAL_NAME,
NORTHERN_MARIANA_ISLANDS_NATIVE_NAME,
NORTHERN_MARIANA_ISLANDS_CAPITAL,
NORTHERN_MARIANA_ISLANDS_NUMERIC_CODE,
NORTHERN_MARIANA_ISLANDS_ISO2_CODE,
NORTHERN_MARIANA_ISLANDS_ISO3_CODE,
NORTHERN_MARIANA_ISLANDS_CALLING_CODE,
EXPECTED_STATES
);
}
}
52 changes: 52 additions & 0 deletions src/World.Net.UnitTests/Countries/NorwayTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace World.Net.UnitTests.Countries;

public sealed class NorwayTest : AssertCountryTestBase
{
private const string NORWAY_COUNTRY_NAME = "Norway";
private const string NORWAY_NATIVE_NAME = "Norge";
private const string NORWAY_CAPITAL = "Oslo";
private const string NORWAY_OFFICIAL_NAME = "Kingdom of Norway";
private const string NORWAY_ISO2_CODE = "NO";
private const string NORWAY_ISO3_CODE = "NOR";
private const int NORWAY_NUMERIC_CODE = 578;
private readonly string[] NORWAY_CALLING_CODE = ["+47"];
private const CountryIdentifier EXPECTEDID = CountryIdentifier.Norway;

private static readonly (string Name, string IsoCode, string Type)[] EXPECTED_STATES =
[
new("Agder", "NO-01", "County"),
new("Innlandet", "NO-02", "County"),
new("Møre og Romsdal", "NO-03", "County"),
new("Nordland", "NO-04", "County"),
new("Oslo", "NO-05", "County"),
new("Rogaland", "NO-06", "County"),
new("Troms og Finnmark", "NO-07", "County"),
new("Trøndelag", "NO-08", "County"),
new("Vestfold og Telemark", "NO-09", "County"),
new("Vestland", "NO-10", "County"),
new("Viken", "NO-11", "County")
];

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

// Assert
AssertCorrectInformation(
country,
EXPECTEDID,
NORWAY_COUNTRY_NAME,
NORWAY_OFFICIAL_NAME,
NORWAY_NATIVE_NAME,
NORWAY_CAPITAL,
NORWAY_NUMERIC_CODE,
NORWAY_ISO2_CODE,
NORWAY_ISO3_CODE,
NORWAY_CALLING_CODE,
EXPECTED_STATES
);
}
}
Loading