diff --git a/Assets/CountryData.Net.Logo.Small.png b/Assets/CountryData.Net.Logo.Small.png new file mode 100644 index 0000000..5516566 Binary files /dev/null and b/Assets/CountryData.Net.Logo.Small.png differ diff --git a/README.md b/README.md index 729000c..39aa3f4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -![Logo](./Assets/CountryData.Net.Logo.png) +Logo +A cross-platform library designed to provide seamless access to global country data for .NET applications without making any http calls. +Our aim is to simplify the process of integrating standardised global data into your applications, making it an ideal tool for developers who require international data. + +### Project Status | | | |-|-| @@ -127,7 +131,6 @@ We are committed to fostering a welcoming and respectful community for everyone. ### Comming Soon -* Support for ISO 4217 Currency Codes * Support for ISO 3166 Country A3 Codes * Country ShortCode Enums diff --git a/src/CountryData.Standard/data.json b/src/CountryData.Standard/data.json index 1cdd489..c5de668 100644 --- a/src/CountryData.Standard/data.json +++ b/src/CountryData.Standard/data.json @@ -11712,60 +11712,32 @@ ], "regions": [ { - "name": "Bagmati", - "shortCode": "BA" + "name": "Koshi", + "shortCode": "1" }, { - "name": "Bheri", - "shortCode": "BH" + "name": "Madhesh", + "shortCode": "2" }, { - "name": "Dhawalagiri", - "shortCode": "DH" + "name": "Bagmati", + "shortCode": "3" }, { "name": "Gandaki", - "shortCode": "GA" - }, - { - "name": "Janakpur", - "shortCode": "JA" - }, - { - "name": "Karnali", - "shortCode": "KA" - }, - { - "name": "Kosi", - "shortCode": "KO" + "shortCode": "4" }, { "name": "Lumbini", - "shortCode": "LU" - }, - { - "name": "Mahakali", - "shortCode": "MA" - }, - { - "name": "Mechi", - "shortCode": "ME" - }, - { - "name": "Narayani", - "shortCode": "NA" - }, - { - "name": "Rapti", - "shortCode": "RA" + "shortCode": "5" }, { - "name": "Sagarmatha", - "shortCode": "SA" + "name": "Karnali", + "shortCode": "6" }, { - "name": "Seti", - "shortCode": "SE" + "name": "Sudurpashchim", + "shortCode": "7" } ] }, @@ -16526,39 +16498,39 @@ ], "regions": [ { - "name": "Basnahira", + "name": "Western Province", "shortCode": "1" }, { - "name": "Dakunu", + "name": "Southern Province", "shortCode": "3" }, { - "name": "Madhyama", + "name": "Central Province", "shortCode": "2" }, { - "name": "Naegenahira", + "name": "Eastern Province", "shortCode": "5" }, { - "name": "Sabaragamuwa", + "name": "Sabaragamuwa Province", "shortCode": "9" }, { - "name": "Uturu", + "name": "Northern Province", "shortCode": "4" }, { - "name": "Uturumaeda", + "name": "North Central Province", "shortCode": "7" }, { - "name": "Vayamba", + "name": "North Western Province", "shortCode": "6" }, { - "name": "Uva", + "name": "Uva Province", "shortCode": "8" } ] diff --git a/test/CountryData.UnitTests/CountryHelperTests.cs b/test/CountryData.UnitTests/CountryHelperTests.cs index 2f5bcf2..b3738c4 100644 --- a/test/CountryData.UnitTests/CountryHelperTests.cs +++ b/test/CountryData.UnitTests/CountryHelperTests.cs @@ -130,9 +130,7 @@ public void GetCountriesByPhoneCode_WithCorrectPhoneCode_ShouldReturnCountries(s countries.Any(c => c.CountryShortCode == expectedShortCode).Should().BeTrue(); } - - - /// + /// /// Tests the GetCurrencyCodesByCountryCode method in the CountryHelper class. /// This test verifies if the method correctly returns the primary currency (code and name) for a given country's short code. /// Assumes that each country has one primary currency for simplicity. @@ -210,7 +208,24 @@ public void GetCountryByCurrencyCode_WhenCountryDataIsNotInitialized_ShouldThrow act.Should().Throw().WithMessage("Country data is not initialized."); } + /// + /// Tests the GetRegionByCountryCode method in the CountryHelper class. + /// This test verifies if the method correctly returns the regions associated with a given country's short code. + /// + /// The short code of the country for which the regions are to be retrieved. + [Theory] + [InlineData("LK")] + public void GetRegions_WithCorrectCode_ShouldReturnCountryRegions(string shortCode) + { + //Act + var regions = _countryHelper.GetRegionByCountryCode(shortCode); - + //Assert + regions.Should().NotBeNull(); + if (shortCode == "LK") + { + regions.Should().HaveCount(9); + } + } }