Skip to content

Commit 3c5a8aa

Browse files
committed
Added Test case for Sri Lanka Regions
1 parent 79cc472 commit 3c5a8aa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/CountryData.UnitTests/CountryHelperTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,26 @@ public void GetCountriesByPhoneCode_WithCorrectPhoneCode_ShouldReturnCountries(s
127127
countries.Should().NotBeNullOrEmpty();
128128
countries.Any(c => c.CountryShortCode == expectedShortCode).Should().BeTrue();
129129
}
130+
131+
132+
/// <summary>
133+
/// Tests the GetRegionByCountryCode method in the CountryHelper class.
134+
/// This test verifies if the method correctly returns the regions associated with a given country's short code.
135+
/// </summary>
136+
/// <param name="shortCode">The short code of the country for which the regions are to be retrieved.</param>
137+
138+
[Theory]
139+
[InlineData("LK")]
140+
public void GetRegions_WithCorrectCode_ShouldReturnCountryRegions(string shortCode)
141+
{
142+
//Act
143+
var regions = _countryHelper.GetRegionByCountryCode(shortCode);
144+
145+
//Assert
146+
regions.Should().NotBeNull();
147+
if (shortCode == "LK")
148+
{
149+
regions.Should().HaveCount(9);
150+
}
151+
}
130152
}

0 commit comments

Comments
 (0)