diff --git a/src/World.Net.UnitTests/Countries/AlbaniaTests.cs b/src/World.Net.UnitTests/Countries/AlbaniaTests.cs new file mode 100644 index 0000000..1b61950 --- /dev/null +++ b/src/World.Net.UnitTests/Countries/AlbaniaTests.cs @@ -0,0 +1,38 @@ +namespace World.Net.UnitTests.Countries; + +public sealed class AlbaniaTests +{ + private const string ALBANIA_NAME = "Albania"; + private const int ALBANIA_STATE_COUNT = 47; + private const string ALBANIA_OFFICIAL_NAME = "Republic of Albania"; + private const string ALBANIA_NATIVE_NAME = "Republika e Shqipërisë"; + private const string ALBANIA_CAPITAL = "Tirana"; + private const int ALBANIA_NUMERIC_CODE = 008; + private const string ALBANIA_ISO2_CODE = "AL"; + private const string ALBANIA_ISO3_CODE = "ALB"; + private const string ALBANIA_CALLING_CODE = "+355"; + + + [Fact] + public void Albania_HasExpectedInformation() + { + // Arrange + int existingCountryId = CountryIdentifier.Albania; + + // Act + var country = CountryProvider.GetCountry(existingCountryId); + + //Assert + Assert.Equal(existingCountryId, country.Id); + Assert.Equal(ALBANIA_NAME, country.Name); + Assert.NotNull(country.States); + Assert.Equal(ALBANIA_STATE_COUNT, country.States.Count()); + Assert.Equal(ALBANIA_OFFICIAL_NAME, country.OfficialName); + Assert.Equal(ALBANIA_NATIVE_NAME, country.NativeName); + Assert.Equal(ALBANIA_CAPITAL, country.Capital); + Assert.Equal(ALBANIA_NUMERIC_CODE, country.NumericCode); + Assert.Equal(ALBANIA_ISO2_CODE, country.ISO2Code); + Assert.Equal(ALBANIA_ISO3_CODE, country.ISO3Code); + Assert.Equal(ALBANIA_CALLING_CODE, country.CallingCode); + } +} diff --git a/src/World.Net/Countries/Albania.cs b/src/World.Net/Countries/Albania.cs new file mode 100644 index 0000000..152abaf --- /dev/null +++ b/src/World.Net/Countries/Albania.cs @@ -0,0 +1,83 @@ +namespace World.Net.Countries; + +internal sealed class Albania : ICountry +{ + /// + public int Id => CountryIdentifier.Albania; + + /// + public string Name => nameof(Albania); + + /// + public string OfficialName { get; } = "Republic of Albania"; + + /// + public string NativeName { get; } = "Republika e Shqipërisë"; + + /// + public string Capital { get; } = "Tirana"; + + /// + public int NumericCode { get; } = 008; + + /// + public string ISO2Code { get; } = "AL"; + + /// + public string ISO3Code { get; } = "ALB"; + + /// + public string CallingCode { get; } = "+355"; + + /// + public IEnumerable States { get; } = + [ + new("Berat", "AL-BR", "District"), + new("Berat", "AL-01", "County"), + new("Bulqizë", "AL-BU", "District"), + new("Delvinë", "AL-DL", "District"), + new("Devoll", "AL-DV", "District"), + new("Dibër", "AL-09", "County"), + new("Dibër", "AL-DI", "District"), + new("Durrës", "AL-DR", "District"), + new("Durrës", "AL-02", "County"), + new("Elbasan", "AL-03", "County"), + new("Fier", "AL-FR", "District"), + new("Fier", "AL-04", "County"), + new("Gjirokastër", "AL-GJ", "District"), + new("Gjirokastër", "AL-05", "County"), + new("Gramsh", "AL-GR", "District"), + new("Has", "AL-HA", "District"), + new("Kavajë", "AL-KA", "District"), + new("Kolonjë", "AL-ER", "District"), + new("Korçë", "AL-06", "County"), + new("Korçë", "AL-KO", "District"), + new("Krujë", "AL-KR", "District"), + new("Kuçovë", "AL-KC", "District"), + new("Kukës", "AL-KU", "District"), + new("Kukës", "AL-07", "County"), + new("Kurbin", "AL-KB", "District"), + new("Lezhë", "AL-08", "County"), + new("Lezhë", "AL-LE", "District"), + new("Librazhd", "AL-LB", "District"), + new("Lushnjë", "AL-LU", "District"), + new("Malësi e Madhe", "AL-MM", "District"), + new("Mallakastër", "AL-MK", "District"), + new("Mat", "AL-MT", "District"), + new("Mirditë", "AL-MR", "District"), + new("Peqin", "AL-PQ", "District"), + new("Përmet", "AL-PR", "District"), + new("Pogradec", "AL-PG", "District"), + new("Pukë", "AL-PU", "District"), + new("Sarandë", "AL-SR", "District"), + new("Shkodër", "AL-10", "County"), + new("Shkodër", "AL-SH", "District"), + new("Skrapar", "AL-SK", "District"), + new("Tepelenë", "AL-TE", "District"), + new("Tirana", "AL-TR", "District"), + new("Tirana", "AL-11", "County"), + new("Tropojë", "AL-TP", "District"), + new("Vlorë", "AL-12", "County"), + new("Vlorë", "AL-VL", "District"), + ]; +} diff --git a/src/World.Net/Helpers/CountryInitializer.cs b/src/World.Net/Helpers/CountryInitializer.cs index d4ad293..15a6cf0 100644 --- a/src/World.Net/Helpers/CountryInitializer.cs +++ b/src/World.Net/Helpers/CountryInitializer.cs @@ -7,7 +7,8 @@ public static Dictionary Initialize() return new Dictionary { { CountryIdentifier.AfghanistanId, new Afghanistan() }, - { CountryIdentifier.AlandIslands, new AlandIslands() } + { CountryIdentifier.AlandIslands, new AlandIslands() }, + { CountryIdentifier.Albania, new Albania() } // Future countries can be added here in the same format. }; }