File tree Expand file tree Collapse file tree 3 files changed +28
-14
lines changed
test/CountryData.UnitTests Expand file tree Collapse file tree 3 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ We are committed to fostering a welcoming and respectful community for everyone.
131131
132132
133133### Comming Soon
134- * Support for ISO 4217 Currency Codes
135134* Support for ISO 3166 Country A3 Codes
136135* Country ShortCode Enums
137136
Original file line number Diff line number Diff line change @@ -16498,39 +16498,39 @@
1649816498 ],
1649916499 "regions" : [
1650016500 {
16501- "name" : " Basnahira " ,
16501+ "name" : " Western Province " ,
1650216502 "shortCode" : " 1"
1650316503 },
1650416504 {
16505- "name" : " Dakunu " ,
16505+ "name" : " Southern Province " ,
1650616506 "shortCode" : " 3"
1650716507 },
1650816508 {
16509- "name" : " Madhyama " ,
16509+ "name" : " Central Province " ,
1651016510 "shortCode" : " 2"
1651116511 },
1651216512 {
16513- "name" : " Naegenahira " ,
16513+ "name" : " Eastern Province " ,
1651416514 "shortCode" : " 5"
1651516515 },
1651616516 {
16517- "name" : " Sabaragamuwa" ,
16517+ "name" : " Sabaragamuwa Province " ,
1651816518 "shortCode" : " 9"
1651916519 },
1652016520 {
16521- "name" : " Uturu " ,
16521+ "name" : " Northern Province " ,
1652216522 "shortCode" : " 4"
1652316523 },
1652416524 {
16525- "name" : " Uturumaeda " ,
16525+ "name" : " North Central Province " ,
1652616526 "shortCode" : " 7"
1652716527 },
1652816528 {
16529- "name" : " Vayamba " ,
16529+ "name" : " North Western Province " ,
1653016530 "shortCode" : " 6"
1653116531 },
1653216532 {
16533- "name" : " Uva" ,
16533+ "name" : " Uva Province " ,
1653416534 "shortCode" : " 8"
1653516535 }
1653616536 ]
Original file line number Diff line number Diff line change @@ -130,9 +130,7 @@ public void GetCountriesByPhoneCode_WithCorrectPhoneCode_ShouldReturnCountries(s
130130 countries . Any ( c => c . CountryShortCode == expectedShortCode ) . Should ( ) . BeTrue ( ) ;
131131 }
132132
133-
134-
135- /// <summary>
133+ /// <summary>
136134 /// Tests the GetCurrencyCodesByCountryCode method in the CountryHelper class.
137135 /// This test verifies if the method correctly returns the primary currency (code and name) for a given country's short code.
138136 /// Assumes that each country has one primary currency for simplicity.
@@ -210,7 +208,24 @@ public void GetCountryByCurrencyCode_WhenCountryDataIsNotInitialized_ShouldThrow
210208 act . Should ( ) . Throw < InvalidOperationException > ( ) . WithMessage ( "Country data is not initialized." ) ;
211209 }
212210
211+ /// <summary>
212+ /// Tests the GetRegionByCountryCode method in the CountryHelper class.
213+ /// This test verifies if the method correctly returns the regions associated with a given country's short code.
214+ /// </summary>
215+ /// <param name="shortCode">The short code of the country for which the regions are to be retrieved.</param>
213216
217+ [ Theory ]
218+ [ InlineData ( "LK" ) ]
219+ public void GetRegions_WithCorrectCode_ShouldReturnCountryRegions ( string shortCode )
220+ {
221+ //Act
222+ var regions = _countryHelper . GetRegionByCountryCode ( shortCode ) ;
214223
215-
224+ //Assert
225+ regions . Should ( ) . NotBeNull ( ) ;
226+ if ( shortCode == "LK" )
227+ {
228+ regions . Should ( ) . HaveCount ( 9 ) ;
229+ }
230+ }
216231}
You can’t perform that action at this time.
0 commit comments