File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
test/CountryData.UnitTests Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments