Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
02d2274
add lebanon state details
selfmadecode Oct 9, 2025
909c6ec
add lesotho
selfmadecode Oct 10, 2025
2bfe923
add liberia
selfmadecode Oct 10, 2025
f8fde04
initialize lebanon, lesotho and liberia
selfmadecode Oct 10, 2025
04e807c
add Liechtenstein
selfmadecode Oct 10, 2025
a7ef439
add Libya
selfmadecode Oct 10, 2025
7cf019e
initialize Liechtenstein and Libya
selfmadecode Oct 10, 2025
06b2ca7
add Lesotho test
selfmadecode Oct 10, 2025
e3f4a25
add lebanon test
selfmadecode Oct 10, 2025
841e423
add lithuania
selfmadecode Oct 10, 2025
3a091e7
add luxembourg
selfmadecode Oct 10, 2025
2ac7e4a
add Macausar
selfmadecode Oct 10, 2025
3dc6b6d
add Madagascar
selfmadecode Oct 10, 2025
abcd568
initalize counties
selfmadecode Oct 10, 2025
d9a8d15
add Liberia test case
selfmadecode Oct 10, 2025
230bfef
update faroe islands test
selfmadecode Oct 12, 2025
606f70c
update fiji test
selfmadecode Oct 12, 2025
2168783
update france tests
selfmadecode Oct 12, 2025
2da255d
french guiana tests
selfmadecode Oct 12, 2025
7423193
add french polynesia test
selfmadecode Oct 12, 2025
77ff7cb
Merge remote-tracking branch 'origin/main' into feat/add-countries
selfmadecode Oct 12, 2025
9ed854c
Merge remote-tracking branch 'origin/main' into feat/add-countries
selfmadecode Oct 12, 2025
520cc2e
update timorleste tests
selfmadecode Oct 13, 2025
9b355cf
Merge remote-tracking branch 'origin/main' into feat/add-countries
selfmadecode Oct 13, 2025
96d38a5
update bahamas test
selfmadecode Oct 13, 2025
a3143f8
update madagascar test
selfmadecode Oct 13, 2025
7742810
update macau sar test
selfmadecode Oct 13, 2025
43d559f
add luxembourge test case
selfmadecode Oct 14, 2025
08b694d
add Lithuania
selfmadecode Oct 14, 2025
93845db
add Liechtenstein
selfmadecode Oct 14, 2025
2c6dd33
add Libya tests
selfmadecode Oct 15, 2025
7fbc7ab
update latvia test
selfmadecode Oct 15, 2025
f3c1086
update Laos tests
selfmadecode Oct 15, 2025
1b7fac1
update test for Kyrgyzstan
selfmadecode Oct 16, 2025
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
39 changes: 15 additions & 24 deletions src/World.Net.UnitTests/Countries/KyrgyzstanTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using World.Net;
using World.Net.Countries;
using World.Net.Helpers;
using Xunit;

namespace World.Net.UnitTests.Countries
namespace World.Net.UnitTests.Countries
{
public class KyrgyzstanTest
public class KyrgyzstanTest : AssertCountryTestBase
{
private const CountryIdentifier ExpectedId = CountryIdentifier.Kyrgyzstan;
private const string ExpectedName = "Kyrgyzstan";
Expand Down Expand Up @@ -33,24 +28,20 @@ private static readonly (string Name, string IsoCode, string Type)[] ExpectedSta
public void GetCountry_ReturnsCorrectInformation_ForKyrgyzstan()
{
var country = CountryProvider.GetCountry(ExpectedId);
Assert.Equal(ExpectedId, country.Id);
Assert.Equal(ExpectedName, country.Name);
Assert.Equal(ExpectedOfficialName, country.OfficialName);
Assert.Equal(ExpectedNativeName, country.NativeName);
Assert.Equal(ExpectedCapital, country.Capital);
Assert.Equal(ExpectedNumericCode, country.NumericCode);
Assert.Equal(ExpectedISO2Code, country.ISO2Code);
Assert.Equal(ExpectedISO3Code, country.ISO3Code);
Assert.Equal(ExpectedCallingCode, country.CallingCode);

var states = country.States.ToArray();
Assert.Equal(ExpectedStates.Length, states.Length);
for (int i = 0; i < states.Length; i++)
{
Assert.Equal(ExpectedStates[i].Name, states[i].Name);
Assert.Equal(ExpectedStates[i].IsoCode, states[i].IsoCode);
Assert.Equal(ExpectedStates[i].Type, states[i].Type);
}
AssertCorrectInformation(
country,
ExpectedId,
ExpectedName,
ExpectedOfficialName,
ExpectedNativeName,
ExpectedCapital,
ExpectedNumericCode,
ExpectedISO2Code,
ExpectedISO3Code,
ExpectedCallingCode,
ExpectedStates
);
}
}
}
32 changes: 14 additions & 18 deletions src/World.Net.UnitTests/Countries/LaosTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace World.Net.UnitTests.Countries
{
public class LaosTest
public class LaosTest : AssertCountryTestBase
{
private const CountryIdentifier ExpectedId = CountryIdentifier.Laos;
private const string ExpectedName = "Laos";
Expand Down Expand Up @@ -38,24 +38,20 @@ private static readonly (string Name, string IsoCode, string Type)[] ExpectedSta
public void GetCountry_ReturnsCorrectInformation_ForLaos()
{
var country = CountryProvider.GetCountry(ExpectedId);
Assert.Equal(ExpectedId, country.Id);
Assert.Equal(ExpectedName, country.Name);
Assert.Equal(ExpectedOfficialName, country.OfficialName);
Assert.Equal(ExpectedNativeName, country.NativeName);
Assert.Equal(ExpectedCapital, country.Capital);
Assert.Equal(ExpectedNumericCode, country.NumericCode);
Assert.Equal(ExpectedISO2Code, country.ISO2Code);
Assert.Equal(ExpectedISO3Code, country.ISO3Code);
Assert.Equal(ExpectedCallingCode, country.CallingCode);

var states = country.States.ToArray();
Assert.Equal(ExpectedStates.Length, states.Length);
for (int i = 0; i < states.Length; i++)
{
Assert.Equal(ExpectedStates[i].Name, states[i].Name);
Assert.Equal(ExpectedStates[i].IsoCode, states[i].IsoCode);
Assert.Equal(ExpectedStates[i].Type, states[i].Type);
}
AssertCorrectInformation(
country,
ExpectedId,
ExpectedName,
ExpectedOfficialName,
ExpectedNativeName,
ExpectedCapital,
ExpectedNumericCode,
ExpectedISO2Code,
ExpectedISO3Code,
ExpectedCallingCode,
ExpectedStates
);
}
}
}
2 changes: 1 addition & 1 deletion src/World.Net.UnitTests/Countries/LatviaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static readonly (string Name, string IsoCode, string Type)[] ExpectedSta


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForLaos()
public void GetCountry_ReturnsCorrectInformation_ForLatvia()
{
var country = CountryProvider.GetCountry(ExpectedId);

Expand Down
63 changes: 63 additions & 0 deletions src/World.Net.UnitTests/Countries/LibyaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries
{
public class LibyaTest : AssertCountryTestBase
{
public static CountryIdentifier Id => CountryIdentifier.Libya;
public string Name { get; } = "Libya";
public string OfficialName { get; } = "State of Libya";
public string NativeName { get; } = "دولة ليبيا";
public string Capital { get; } = "Tripoli";
public int NumericCode { get; } = 434;
public string ISO2Code { get; } = "LY";
public string ISO3Code { get; } = "LBY";
public string[] CallingCode { get; } = ["+218"];
private static readonly (string Name, string IsoCode, string Type)[] States =
[
new("Al Butnan", "LY-BU", "District"),
new("Al Jabal al Akhdar", "LY-JA", "District"),
new("Al Jabal al Gharbi", "LY-JG", "District"),
new("Al Jafara", "LY-JI", "District"),
new("Al Jufra", "LY-JU", "District"),
new("Al Kufra", "LY-KF", "District"),
new("Al Marj", "LY-MJ", "District"),
new("Al Marqab", "LY-MB", "District"),
new("Al Wahat", "LY-WA", "District"),
new("Nalut", "LY-NL", "District"),
new("Misrata", "LY-MI", "District"),
new("Murzuq", "LY-MQ", "District"),
new("Sabha", "LY-SB", "District"),
new("Sirt", "LY-SR", "District"),
new("Tripoli", "LY-TB", "District"),
new("Wadi al Hayat", "LY-WD", "District"),
new("Wadi ash Shati'", "LY-WS", "District"),
new("Zawiya", "LY-ZA", "District")
];


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForLibya()
{
var country = CountryProvider.GetCountry(Id);

AssertCorrectInformation(
country,
Id,
Name,
OfficialName,
NativeName,
Capital,
NumericCode,
ISO2Code,
ISO3Code,
CallingCode,
States
);
}
}
}
56 changes: 56 additions & 0 deletions src/World.Net.UnitTests/Countries/LiechtensteinTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries
{
public sealed class LiechtensteinTest : AssertCountryTestBase
{
public static CountryIdentifier Id => CountryIdentifier.Liechtenstein;
public string Name { get; } = "Liechtenstein";
public string OfficialName { get; } = "Principality of Liechtenstein";
public string NativeName { get; } = "Fürstentum Liechtenstein";
public string Capital { get; } = "Vaduz";
public int NumericCode { get; } = 438;
public string ISO2Code { get; } = "LI";
public string ISO3Code { get; } = "LIE";
public string[] CallingCode { get; } = ["+423"];
private static readonly (string Name, string IsoCode, string Type)[] States =
[
new("Balzers", "LI-01", "Municipality"),
new("Eschen", "LI-02", "Municipality"),
new("Gamprin", "LI-03", "Municipality"),
new("Mauren", "LI-04", "Municipality"),
new("Planken", "LI-05", "Municipality"),
new("Ruggell", "LI-06", "Municipality"),
new("Schaan", "LI-07", "Municipality"),
new("Schellenberg", "LI-08", "Municipality"),
new("Triesen", "LI-09", "Municipality"),
new("Triesenberg", "LI-10", "Municipality"),
new("Vaduz", "LI-11", "Municipality")
];


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForLiechtenstein()
{
var country = CountryProvider.GetCountry(Id);

AssertCorrectInformation(
country,
Id,
Name,
OfficialName,
NativeName,
Capital,
NumericCode,
ISO2Code,
ISO3Code,
CallingCode,
States
);
}
}
}
55 changes: 55 additions & 0 deletions src/World.Net.UnitTests/Countries/LithuaniaTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries
{
public class LithuaniaTest : AssertCountryTestBase
{
public static CountryIdentifier Id => CountryIdentifier.Lithuania;
public string Name { get; } = "Lithuania";
public string OfficialName { get; } = "Republic of Lithuania";
public string NativeName { get; } = "Lietuvos Respublika";
public string Capital { get; } = "Vilnius";
public int NumericCode { get; } = 440;
public string ISO2Code { get; } = "LT";
public string ISO3Code { get; } = "LTU";
public string[] CallingCode { get; } = ["+370"];
private static readonly (string Name, string IsoCode, string Type)[] States =
[
new("Alytus County", "LT-AL", "County"),
new("Kaunas County", "LT-KU", "County"),
new("Klaipėda County", "LT-KL", "County"),
new("Marijampolė County", "LT-MR", "County"),
new("Panevėžys County", "LT-PN", "County"),
new("Šiauliai County", "LT-SA", "County"),
new("Tauragė County", "LT-TA", "County"),
new("Telšiai County", "LT-TE", "County"),
new("Utena County", "LT-UT", "County"),
new("Vilnius County", "LT-VL", "County")
];


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForLithuania()
{
var country = CountryProvider.GetCountry(Id);

AssertCorrectInformation(
country,
Id,
Name,
OfficialName,
NativeName,
Capital,
NumericCode,
ISO2Code,
ISO3Code,
CallingCode,
States
);
}
}
}
57 changes: 57 additions & 0 deletions src/World.Net.UnitTests/Countries/LuxembourgTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries
{
public class LuxembourgTest : AssertCountryTestBase
{
public static CountryIdentifier Id => CountryIdentifier.Luxembourg;
public string Name { get; } = "Luxembourg";
public string OfficialName { get; } = "Grand Duchy of Luxembourg";
public string NativeName { get; } = "Groussherzogtum Lëtzebuerg";
public string Capital { get; } = "Luxembourg City";
public int NumericCode { get; } = 442;
public string ISO2Code { get; } = "LU";
public string ISO3Code { get; } = "LUX";
public string[] CallingCode { get; } = ["+352"];
private static readonly (string Name, string IsoCode, string Type)[] States =
[
new("Capellen", "LU-CA", "Canton"),
new("Clervaux", "LU-CL", "Canton"),
new("Diekirch", "LU-DI", "Canton"),
new("Echternach", "LU-EC", "Canton"),
new("Esch-sur-Alzette", "LU-ES", "Canton"),
new("Grevenmacher", "LU-GR", "Canton"),
new("Luxembourg", "LU-LU", "Canton"),
new("Mersch", "LU-ME", "Canton"),
new("Redange", "LU-RD", "Canton"),
new("Remich", "LU-RM", "Canton"),
new("Vianden", "LU-VD", "Canton"),
new("Wiltz", "LU-WI", "Canton")
];


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForLuxembourg()
{
var country = CountryProvider.GetCountry(Id);

AssertCorrectInformation(
country,
Id,
Name,
OfficialName,
NativeName,
Capital,
NumericCode,
ISO2Code,
ISO3Code,
CallingCode,
States
);
}
}
}
49 changes: 49 additions & 0 deletions src/World.Net.UnitTests/Countries/MacauSARTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace World.Net.UnitTests.Countries
{
public class MacauSARTest : AssertCountryTestBase
{
public static CountryIdentifier Id => CountryIdentifier.MacauSAR;
public string Name { get; } = "Macau S.A.R.";
public string OfficialName { get; } = "Macao Special Administrative Region of the People's Republic of China";
public string NativeName { get; } = "中華人民共和國澳門特別行政區";
public string Capital { get; } = "Macau";
public int NumericCode { get; } = 446;
public string ISO2Code { get; } = "MO";
public string ISO3Code { get; } = "MAC";
public string[] CallingCode { get; } = ["+853"];
private static readonly (string Name, string IsoCode, string Type)[] States =
[
new("Macau Peninsula", "MO-PN", "Region"),
new("Taipa", "MO-TA", "Region"),
new("Coloane", "MO-CO", "Region"),
new("Cotai", "MO-CT", "Region")
];


[Fact]
public void GetCountry_ReturnsCorrectInformation_ForMacauSAR()
{
var country = CountryProvider.GetCountry(Id);

AssertCorrectInformation(
country,
Id,
Name,
OfficialName,
NativeName,
Capital,
NumericCode,
ISO2Code,
ISO3Code,
CallingCode,
States
);
}
}
}
Loading