Skip to content

Commit 132e4be

Browse files
authored
add Lebanon and 8 other countries (#70)
* add lebanon state details * add lesotho * add liberia * initialize lebanon, lesotho and liberia * add Liechtenstein * add Libya * initialize Liechtenstein and Libya * add Lesotho test * add lebanon test * add lithuania * add luxembourg * add Macausar * add Madagascar * initalize counties * add Liberia test case
1 parent 4b6a166 commit 132e4be

13 files changed

Lines changed: 617 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
namespace World.Net.UnitTests.Countries
2+
{
3+
public class LebanonTest : AssertCountryTestBase
4+
{
5+
private CountryIdentifier Id => CountryIdentifier.Lebanon;
6+
private string Name { get; } = "Lebanon";
7+
private string OfficialName { get; } = "Lebanese Republic";
8+
private string NativeName { get; } = "الجمهورية اللبنانية";
9+
private string Capital { get; } = "Beirut";
10+
private int NumericCode { get; } = 422;
11+
private string ISO2Code { get; } = "LB";
12+
private string ISO3Code { get; } = "LBN";
13+
private string[] CallingCode { get; } = ["+961"];
14+
private static readonly (string Name, string IsoCode, string Type)[] States =
15+
[
16+
new("Akkar", "LB-AK", "Governorate"),
17+
new("Baalbek-Hermel", "LB-BH", "Governorate"),
18+
new("Beirut", "LB-BA", "Governorate"),
19+
new("Beqaa", "LB-BI", "Governorate"),
20+
new("Mount Lebanon", "LB-JL", "Governorate"),
21+
new("Nabatieh", "LB-NA", "Governorate"),
22+
new("North Lebanon", "LB-AS", "Governorate"),
23+
new("South Lebanon", "LB-JA", "Governorate")
24+
];
25+
26+
27+
[Fact]
28+
public void GetCountry_ReturnsCorrectInformation_ForLebanon()
29+
{
30+
var country = CountryProvider.GetCountry(Id);
31+
32+
AssertCorrectInformation(
33+
country,
34+
Id,
35+
Name,
36+
OfficialName,
37+
NativeName,
38+
Capital,
39+
NumericCode,
40+
ISO2Code,
41+
ISO3Code,
42+
CallingCode,
43+
States
44+
);
45+
}
46+
}
47+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace World.Net.UnitTests.Countries
2+
{
3+
public class LesothoTest : AssertCountryTestBase
4+
{
5+
public static CountryIdentifier Id => CountryIdentifier.Lesotho;
6+
public string Name { get; } = "Lesotho";
7+
public string OfficialName { get; } = "Kingdom of Lesotho";
8+
public string NativeName { get; } = "Muso oa Lesotho";
9+
public string Capital { get; } = "Maseru";
10+
public int NumericCode { get; } = 426;
11+
public string ISO2Code { get; } = "LS";
12+
public string ISO3Code { get; } = "LSO";
13+
public string[] CallingCode { get; } = ["+266"];
14+
private static readonly (string Name, string IsoCode, string Type)[] States =
15+
[
16+
new("Berea", "LS-D", "District"),
17+
new("Butha-Buthe", "LS-B", "District"),
18+
new("Leribe", "LS-C", "District"),
19+
new("Mafeteng", "LS-E", "District"),
20+
new("Maseru", "LS-A", "District"),
21+
new("Mohale's Hoek", "LS-F", "District"),
22+
new("Mokhotlong", "LS-J", "District"),
23+
new("Qacha's Nek", "LS-H", "District"),
24+
new("Quthing", "LS-G", "District"),
25+
new("Thaba-Tseka", "LS-K", "District")
26+
];
27+
28+
29+
[Fact]
30+
public void GetCountry_ReturnsCorrectInformation_ForLebanon()
31+
{
32+
var country = CountryProvider.GetCountry(Id);
33+
34+
AssertCorrectInformation(
35+
country,
36+
Id,
37+
Name,
38+
OfficialName,
39+
NativeName,
40+
Capital,
41+
NumericCode,
42+
ISO2Code,
43+
ISO3Code,
44+
CallingCode,
45+
States
46+
);
47+
}
48+
}
49+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
namespace World.Net.UnitTests.Countries
2+
{
3+
public class LiberiaTest : AssertCountryTestBase
4+
{
5+
public static CountryIdentifier Id => CountryIdentifier.Liberia;
6+
public string Name { get; } = "Liberia";
7+
public string OfficialName { get; } = "Republic of Liberia";
8+
public string NativeName { get; } = "Republic of Liberia";
9+
public string Capital { get; } = "Monrovia";
10+
public int NumericCode { get; } = 430;
11+
public string ISO2Code { get; } = "LR";
12+
public string ISO3Code { get; } = "LBR";
13+
public string[] CallingCode { get; } = ["+231"];
14+
private static readonly (string Name, string IsoCode, string Type)[] States =
15+
[
16+
new("Bomi", "LR-BM", "County"),
17+
new("Bong", "LR-BG", "County"),
18+
new("Gbarpolu", "LR-GP", "County"),
19+
new("Grand Bassa", "LR-GB", "County"),
20+
new("Grand Cape Mount", "LR-CM", "County"),
21+
new("Grand Gedeh", "LR-GG", "County"),
22+
new("Grand Kru", "LR-GK", "County"),
23+
new("Lofa", "LR-LO", "County"),
24+
new("Margibi", "LR-MG", "County"),
25+
new("Maryland", "LR-MY", "County"),
26+
new("Montserrado", "LR-MO", "County"),
27+
new("Nimba", "LR-NI", "County"),
28+
new("River Cess", "LR-RI", "County"),
29+
new("River Gee", "LR-RG", "County"),
30+
new("Sinoe", "LR-SI", "County")
31+
];
32+
33+
34+
[Fact]
35+
public void GetCountry_ReturnsCorrectInformation_ForLebanon()
36+
{
37+
var country = CountryProvider.GetCountry(Id);
38+
39+
AssertCorrectInformation(
40+
country,
41+
Id,
42+
Name,
43+
OfficialName,
44+
NativeName,
45+
Capital,
46+
NumericCode,
47+
ISO2Code,
48+
ISO3Code,
49+
CallingCode,
50+
States
51+
);
52+
}
53+
}
54+
}

src/World.Net/Countries/Lebanon.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
namespace World.Net.Countries
2+
{
3+
internal sealed class Lebanon : ICountry
4+
{
5+
//<inheritdoc/>
6+
public CountryIdentifier Id => CountryIdentifier.Lebanon;
7+
8+
//<inheritdoc/>
9+
public string Name { get; } = "Lebanon";
10+
11+
//<inheritdoc/>
12+
public string OfficialName { get; } = "Lebanese Republic";
13+
14+
//<inheritdoc/>
15+
public string NativeName { get; } = "الجمهورية اللبنانية";
16+
17+
//<inheritdoc/>
18+
public string Capital { get; } = "Beirut";
19+
20+
//<inheritdoc/>
21+
public int NumericCode { get; } = 422;
22+
23+
//<inheritdoc/>
24+
public string ISO2Code { get; } = "LB";
25+
26+
//<inheritdoc/>
27+
public string ISO3Code { get; } = "LBN";
28+
29+
//<inheritdoc/>
30+
public string[] CallingCode { get; } = ["+961"];
31+
32+
//<inheritdoc/>
33+
public IEnumerable<State> States { get; } =
34+
[
35+
new("Akkar", "LB-AK", "Governorate"),
36+
new("Baalbek-Hermel", "LB-BH", "Governorate"),
37+
new("Beirut", "LB-BA", "Governorate"),
38+
new("Beqaa", "LB-BI", "Governorate"),
39+
new("Mount Lebanon", "LB-JL", "Governorate"),
40+
new("Nabatieh", "LB-NA", "Governorate"),
41+
new("North Lebanon", "LB-AS", "Governorate"),
42+
new("South Lebanon", "LB-JA", "Governorate")
43+
];
44+
}
45+
46+
}

src/World.Net/Countries/Lesotho.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
namespace World.Net.Countries
2+
{
3+
internal sealed class Lesotho : ICountry
4+
{
5+
//<inheritdoc/>
6+
public CountryIdentifier Id => CountryIdentifier.Lesotho;
7+
8+
//<inheritdoc/>
9+
public string Name { get; } = "Lesotho";
10+
11+
//<inheritdoc/>
12+
public string OfficialName { get; } = "Kingdom of Lesotho";
13+
14+
//<inheritdoc/>
15+
public string NativeName { get; } = "Muso oa Lesotho";
16+
17+
//<inheritdoc/>
18+
public string Capital { get; } = "Maseru";
19+
20+
//<inheritdoc/>
21+
public int NumericCode { get; } = 426;
22+
23+
//<inheritdoc/>
24+
public string ISO2Code { get; } = "LS";
25+
26+
//<inheritdoc/>
27+
public string ISO3Code { get; } = "LSO";
28+
29+
//<inheritdoc/>
30+
public string[] CallingCode { get; } = ["+266"];
31+
32+
//<inheritdoc/>
33+
public IEnumerable<State> States { get; } =
34+
[
35+
new("Berea", "LS-D", "District"),
36+
new("Butha-Buthe", "LS-B", "District"),
37+
new("Leribe", "LS-C", "District"),
38+
new("Mafeteng", "LS-E", "District"),
39+
new("Maseru", "LS-A", "District"),
40+
new("Mohale's Hoek", "LS-F", "District"),
41+
new("Mokhotlong", "LS-J", "District"),
42+
new("Qacha's Nek", "LS-H", "District"),
43+
new("Quthing", "LS-G", "District"),
44+
new("Thaba-Tseka", "LS-K", "District")
45+
];
46+
}
47+
}

src/World.Net/Countries/Liberia.cs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace World.Net.Countries
6+
{
7+
internal sealed class Liberia : ICountry
8+
{
9+
10+
//<inheritdoc/>
11+
public CountryIdentifier Id => CountryIdentifier.Liberia;
12+
13+
//<inheritdoc/>
14+
public string Name { get; } = "Liberia";
15+
16+
//<inheritdoc/>
17+
public string OfficialName { get; } = "Republic of Liberia";
18+
19+
//<inheritdoc/>
20+
public string NativeName { get; } = "Republic of Liberia";
21+
22+
//<inheritdoc/>
23+
public string Capital { get; } = "Monrovia";
24+
25+
//<inheritdoc/>
26+
public int NumericCode { get; } = 430;
27+
28+
//<inheritdoc/>
29+
public string ISO2Code { get; } = "LR";
30+
31+
//<inheritdoc/>
32+
public string ISO3Code { get; } = "LBR";
33+
34+
//<inheritdoc/>
35+
public string[] CallingCode { get; } = ["+231"];
36+
37+
//<inheritdoc/>
38+
public IEnumerable<State> States { get; } =
39+
[
40+
new("Bomi", "LR-BM", "County"),
41+
new("Bong", "LR-BG", "County"),
42+
new("Gbarpolu", "LR-GP", "County"),
43+
new("Grand Bassa", "LR-GB", "County"),
44+
new("Grand Cape Mount", "LR-CM", "County"),
45+
new("Grand Gedeh", "LR-GG", "County"),
46+
new("Grand Kru", "LR-GK", "County"),
47+
new("Lofa", "LR-LO", "County"),
48+
new("Margibi", "LR-MG", "County"),
49+
new("Maryland", "LR-MY", "County"),
50+
new("Montserrado", "LR-MO", "County"),
51+
new("Nimba", "LR-NI", "County"),
52+
new("River Cess", "LR-RI", "County"),
53+
new("River Gee", "LR-RG", "County"),
54+
new("Sinoe", "LR-SI", "County")
55+
];
56+
}
57+
58+
}

src/World.Net/Countries/Libya.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
namespace World.Net.Countries
2+
{
3+
internal sealed class Libya : ICountry
4+
{
5+
6+
//<inheritdoc/>
7+
public CountryIdentifier Id => CountryIdentifier.Libya;
8+
9+
//<inheritdoc/>
10+
public string Name { get; } = "Libya";
11+
12+
//<inheritdoc/>
13+
public string OfficialName { get; } = "State of Libya";
14+
15+
//<inheritdoc/>
16+
public string NativeName { get; } = "دولة ليبيا";
17+
18+
//<inheritdoc/>
19+
public string Capital { get; } = "Tripoli";
20+
21+
//<inheritdoc/>
22+
public int NumericCode { get; } = 434;
23+
24+
//<inheritdoc/>
25+
public string ISO2Code { get; } = "LY";
26+
27+
//<inheritdoc/>
28+
public string ISO3Code { get; } = "LBY";
29+
30+
//<inheritdoc/>
31+
public string[] CallingCode { get; } = ["+218"];
32+
33+
//<inheritdoc/>
34+
public IEnumerable<State> States { get; } =
35+
[
36+
new("Al Butnan", "LY-BU", "District"),
37+
new("Al Jabal al Akhdar", "LY-JA", "District"),
38+
new("Al Jabal al Gharbi", "LY-JG", "District"),
39+
new("Al Jafara", "LY-JI", "District"),
40+
new("Al Jufra", "LY-JU", "District"),
41+
new("Al Kufra", "LY-KF", "District"),
42+
new("Al Marj", "LY-MJ", "District"),
43+
new("Al Marqab", "LY-MB", "District"),
44+
new("Al Wahat", "LY-WA", "District"),
45+
new("Nalut", "LY-NL", "District"),
46+
new("Misrata", "LY-MI", "District"),
47+
new("Murzuq", "LY-MQ", "District"),
48+
new("Sabha", "LY-SB", "District"),
49+
new("Sirt", "LY-SR", "District"),
50+
new("Tripoli", "LY-TB", "District"),
51+
new("Wadi al Hayat", "LY-WD", "District"),
52+
new("Wadi ash Shati'", "LY-WS", "District"),
53+
new("Zawiya", "LY-ZA", "District")
54+
];
55+
}
56+
57+
}

0 commit comments

Comments
 (0)