diff --git a/src/World.Net.UnitTests/Countries/LebanonTest.cs b/src/World.Net.UnitTests/Countries/LebanonTest.cs new file mode 100644 index 0000000..6b5cc26 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/LebanonTest.cs @@ -0,0 +1,47 @@ +namespace World.Net.UnitTests.Countries +{ + public class LebanonTest : AssertCountryTestBase + { + private CountryIdentifier Id => CountryIdentifier.Lebanon; + private string Name { get; } = "Lebanon"; + private string OfficialName { get; } = "Lebanese Republic"; + private string NativeName { get; } = "الجمهورية اللبنانية"; + private string Capital { get; } = "Beirut"; + private int NumericCode { get; } = 422; + private string ISO2Code { get; } = "LB"; + private string ISO3Code { get; } = "LBN"; + private string[] CallingCode { get; } = ["+961"]; + private static readonly (string Name, string IsoCode, string Type)[] States = + [ + new("Akkar", "LB-AK", "Governorate"), + new("Baalbek-Hermel", "LB-BH", "Governorate"), + new("Beirut", "LB-BA", "Governorate"), + new("Beqaa", "LB-BI", "Governorate"), + new("Mount Lebanon", "LB-JL", "Governorate"), + new("Nabatieh", "LB-NA", "Governorate"), + new("North Lebanon", "LB-AS", "Governorate"), + new("South Lebanon", "LB-JA", "Governorate") + ]; + + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForLebanon() + { + var country = CountryProvider.GetCountry(Id); + + AssertCorrectInformation( + country, + Id, + Name, + OfficialName, + NativeName, + Capital, + NumericCode, + ISO2Code, + ISO3Code, + CallingCode, + States + ); + } + } +} diff --git a/src/World.Net.UnitTests/Countries/LesothoTest.cs b/src/World.Net.UnitTests/Countries/LesothoTest.cs new file mode 100644 index 0000000..2423d74 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/LesothoTest.cs @@ -0,0 +1,49 @@ +namespace World.Net.UnitTests.Countries +{ + public class LesothoTest : AssertCountryTestBase + { + public static CountryIdentifier Id => CountryIdentifier.Lesotho; + public string Name { get; } = "Lesotho"; + public string OfficialName { get; } = "Kingdom of Lesotho"; + public string NativeName { get; } = "Muso oa Lesotho"; + public string Capital { get; } = "Maseru"; + public int NumericCode { get; } = 426; + public string ISO2Code { get; } = "LS"; + public string ISO3Code { get; } = "LSO"; + public string[] CallingCode { get; } = ["+266"]; + private static readonly (string Name, string IsoCode, string Type)[] States = + [ + new("Berea", "LS-D", "District"), + new("Butha-Buthe", "LS-B", "District"), + new("Leribe", "LS-C", "District"), + new("Mafeteng", "LS-E", "District"), + new("Maseru", "LS-A", "District"), + new("Mohale's Hoek", "LS-F", "District"), + new("Mokhotlong", "LS-J", "District"), + new("Qacha's Nek", "LS-H", "District"), + new("Quthing", "LS-G", "District"), + new("Thaba-Tseka", "LS-K", "District") + ]; + + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForLebanon() + { + var country = CountryProvider.GetCountry(Id); + + AssertCorrectInformation( + country, + Id, + Name, + OfficialName, + NativeName, + Capital, + NumericCode, + ISO2Code, + ISO3Code, + CallingCode, + States + ); + } + } +} diff --git a/src/World.Net.UnitTests/Countries/LiberiaTest.cs b/src/World.Net.UnitTests/Countries/LiberiaTest.cs new file mode 100644 index 0000000..176a815 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/LiberiaTest.cs @@ -0,0 +1,54 @@ +namespace World.Net.UnitTests.Countries +{ + public class LiberiaTest : AssertCountryTestBase + { + public static CountryIdentifier Id => CountryIdentifier.Liberia; + public string Name { get; } = "Liberia"; + public string OfficialName { get; } = "Republic of Liberia"; + public string NativeName { get; } = "Republic of Liberia"; + public string Capital { get; } = "Monrovia"; + public int NumericCode { get; } = 430; + public string ISO2Code { get; } = "LR"; + public string ISO3Code { get; } = "LBR"; + public string[] CallingCode { get; } = ["+231"]; + private static readonly (string Name, string IsoCode, string Type)[] States = + [ + new("Bomi", "LR-BM", "County"), + new("Bong", "LR-BG", "County"), + new("Gbarpolu", "LR-GP", "County"), + new("Grand Bassa", "LR-GB", "County"), + new("Grand Cape Mount", "LR-CM", "County"), + new("Grand Gedeh", "LR-GG", "County"), + new("Grand Kru", "LR-GK", "County"), + new("Lofa", "LR-LO", "County"), + new("Margibi", "LR-MG", "County"), + new("Maryland", "LR-MY", "County"), + new("Montserrado", "LR-MO", "County"), + new("Nimba", "LR-NI", "County"), + new("River Cess", "LR-RI", "County"), + new("River Gee", "LR-RG", "County"), + new("Sinoe", "LR-SI", "County") + ]; + + + [Fact] + public void GetCountry_ReturnsCorrectInformation_ForLebanon() + { + var country = CountryProvider.GetCountry(Id); + + AssertCorrectInformation( + country, + Id, + Name, + OfficialName, + NativeName, + Capital, + NumericCode, + ISO2Code, + ISO3Code, + CallingCode, + States + ); + } + } +} diff --git a/src/World.Net/Countries/Lebanon.cs b/src/World.Net/Countries/Lebanon.cs new file mode 100644 index 0000000..8e02af1 --- /dev/null +++ b/src/World.Net/Countries/Lebanon.cs @@ -0,0 +1,46 @@ +namespace World.Net.Countries +{ + internal sealed class Lebanon : ICountry + { + // + public CountryIdentifier Id => CountryIdentifier.Lebanon; + + // + public string Name { get; } = "Lebanon"; + + // + public string OfficialName { get; } = "Lebanese Republic"; + + // + public string NativeName { get; } = "الجمهورية اللبنانية"; + + // + public string Capital { get; } = "Beirut"; + + // + public int NumericCode { get; } = 422; + + // + public string ISO2Code { get; } = "LB"; + + // + public string ISO3Code { get; } = "LBN"; + + // + public string[] CallingCode { get; } = ["+961"]; + + // + public IEnumerable States { get; } = + [ + new("Akkar", "LB-AK", "Governorate"), + new("Baalbek-Hermel", "LB-BH", "Governorate"), + new("Beirut", "LB-BA", "Governorate"), + new("Beqaa", "LB-BI", "Governorate"), + new("Mount Lebanon", "LB-JL", "Governorate"), + new("Nabatieh", "LB-NA", "Governorate"), + new("North Lebanon", "LB-AS", "Governorate"), + new("South Lebanon", "LB-JA", "Governorate") + ]; + } + +} diff --git a/src/World.Net/Countries/Lesotho.cs b/src/World.Net/Countries/Lesotho.cs new file mode 100644 index 0000000..2816bc7 --- /dev/null +++ b/src/World.Net/Countries/Lesotho.cs @@ -0,0 +1,47 @@ +namespace World.Net.Countries +{ + internal sealed class Lesotho : ICountry + { + // + public CountryIdentifier Id => CountryIdentifier.Lesotho; + + // + public string Name { get; } = "Lesotho"; + + // + public string OfficialName { get; } = "Kingdom of Lesotho"; + + // + public string NativeName { get; } = "Muso oa Lesotho"; + + // + public string Capital { get; } = "Maseru"; + + // + public int NumericCode { get; } = 426; + + // + public string ISO2Code { get; } = "LS"; + + // + public string ISO3Code { get; } = "LSO"; + + // + public string[] CallingCode { get; } = ["+266"]; + + // + public IEnumerable States { get; } = + [ + new("Berea", "LS-D", "District"), + new("Butha-Buthe", "LS-B", "District"), + new("Leribe", "LS-C", "District"), + new("Mafeteng", "LS-E", "District"), + new("Maseru", "LS-A", "District"), + new("Mohale's Hoek", "LS-F", "District"), + new("Mokhotlong", "LS-J", "District"), + new("Qacha's Nek", "LS-H", "District"), + new("Quthing", "LS-G", "District"), + new("Thaba-Tseka", "LS-K", "District") + ]; + } +} diff --git a/src/World.Net/Countries/Liberia.cs b/src/World.Net/Countries/Liberia.cs new file mode 100644 index 0000000..4eab108 --- /dev/null +++ b/src/World.Net/Countries/Liberia.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class Liberia : ICountry + { + + // + public CountryIdentifier Id => CountryIdentifier.Liberia; + + // + public string Name { get; } = "Liberia"; + + // + public string OfficialName { get; } = "Republic of Liberia"; + + // + public string NativeName { get; } = "Republic of Liberia"; + + // + public string Capital { get; } = "Monrovia"; + + // + public int NumericCode { get; } = 430; + + // + public string ISO2Code { get; } = "LR"; + + // + public string ISO3Code { get; } = "LBR"; + + // + public string[] CallingCode { get; } = ["+231"]; + + // + public IEnumerable States { get; } = + [ + new("Bomi", "LR-BM", "County"), + new("Bong", "LR-BG", "County"), + new("Gbarpolu", "LR-GP", "County"), + new("Grand Bassa", "LR-GB", "County"), + new("Grand Cape Mount", "LR-CM", "County"), + new("Grand Gedeh", "LR-GG", "County"), + new("Grand Kru", "LR-GK", "County"), + new("Lofa", "LR-LO", "County"), + new("Margibi", "LR-MG", "County"), + new("Maryland", "LR-MY", "County"), + new("Montserrado", "LR-MO", "County"), + new("Nimba", "LR-NI", "County"), + new("River Cess", "LR-RI", "County"), + new("River Gee", "LR-RG", "County"), + new("Sinoe", "LR-SI", "County") + ]; + } + +} diff --git a/src/World.Net/Countries/Libya.cs b/src/World.Net/Countries/Libya.cs new file mode 100644 index 0000000..8883f2c --- /dev/null +++ b/src/World.Net/Countries/Libya.cs @@ -0,0 +1,57 @@ +namespace World.Net.Countries +{ + internal sealed class Libya : ICountry + { + + // + public 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"]; + + // + public IEnumerable States { get; } = + [ + 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") + ]; + } + +} diff --git a/src/World.Net/Countries/Liechtenstein.cs b/src/World.Net/Countries/Liechtenstein.cs new file mode 100644 index 0000000..4e85abd --- /dev/null +++ b/src/World.Net/Countries/Liechtenstein.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class Liechtenstein : ICountry + { + // + public 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"]; + + // + public IEnumerable States { get; } = + [ + 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") + ]; + } + +} diff --git a/src/World.Net/Countries/Lithuania.cs b/src/World.Net/Countries/Lithuania.cs new file mode 100644 index 0000000..db766fe --- /dev/null +++ b/src/World.Net/Countries/Lithuania.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class Lithuania : ICountry + { + // + public 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"]; + + // + public IEnumerable States { get; } = + [ + 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") + ]; + } +} diff --git a/src/World.Net/Countries/Luxembourg.cs b/src/World.Net/Countries/Luxembourg.cs new file mode 100644 index 0000000..59066fb --- /dev/null +++ b/src/World.Net/Countries/Luxembourg.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class Luxembourg : ICountry + { + // + public 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"]; + + // + public IEnumerable States { get; } = + [ + 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") + ]; + } +} diff --git a/src/World.Net/Countries/MacauSAR.cs b/src/World.Net/Countries/MacauSAR.cs new file mode 100644 index 0000000..393321e --- /dev/null +++ b/src/World.Net/Countries/MacauSAR.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class MacauSAR : ICountry + { + /// + public 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"]; + + /// + public IEnumerable States { get; } = + [ + new("Macau Peninsula", "MO-PN", "Region"), + new("Taipa", "MO-TA", "Region"), + new("Coloane", "MO-CO", "Region"), + new("Cotai", "MO-CT", "Region") + ]; + } + +} diff --git a/src/World.Net/Countries/Madagascar.cs b/src/World.Net/Countries/Madagascar.cs new file mode 100644 index 0000000..09db393 --- /dev/null +++ b/src/World.Net/Countries/Madagascar.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace World.Net.Countries +{ + internal sealed class Madagascar : ICountry + { + /// + public CountryIdentifier Id => CountryIdentifier.Madagascar; + + /// + public string Name { get; } = "Madagascar"; + + /// + public string OfficialName { get; } = "Republic of Madagascar"; + + /// + public string NativeName { get; } = "Repoblikan’i Madagasikara"; + + /// + public string Capital { get; } = "Antananarivo"; + + /// + public int NumericCode { get; } = 450; + + /// + public string ISO2Code { get; } = "MG"; + + /// + public string ISO3Code { get; } = "MDG"; + + /// + public string[] CallingCode { get; } = ["+261"]; + + /// + public IEnumerable States { get; } = + [ + new("Antananarivo", "MG-T", "Province"), + new("Antsiranana", "MG-D", "Province"), + new("Fianarantsoa", "MG-F", "Province"), + new("Mahajanga", "MG-M", "Province"), + new("Toamasina", "MG-A", "Province"), + new("Toliara", "MG-U", "Province") + ]; + } +} diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index c58af85..e856a5f 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -100,6 +100,15 @@ public static Dictionary Initialize() { CountryIdentifier.Kyrgyzstan, new Kyrgyzstan() }, { CountryIdentifier.Laos, new Laos() }, { CountryIdentifier.Latvia, new Latvia() }, + { CountryIdentifier.Lebanon, new Lebanon() }, + { CountryIdentifier.Lesotho, new Lesotho() }, + { CountryIdentifier.Liberia, new Liberia() }, + { CountryIdentifier.Libya, new Libya() }, + { CountryIdentifier.Liechtenstein, new Liechtenstein() }, + { CountryIdentifier.Lithuania, new Lithuania() }, + { CountryIdentifier.Luxembourg, new Luxembourg() }, + { CountryIdentifier.MacauSAR, new MacauSAR() }, + { CountryIdentifier.Madagascar, new Madagascar() }, // Future countries can be added here in the same format. };