Skip to content

Commit

Permalink
Add latvia support
Browse files Browse the repository at this point in the history
  • Loading branch information
picolino committed Nov 27, 2021
1 parent c4db572 commit 7c8b6c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ private static IEnumerable UrlConstructionTestData()
yield return new TestCaseData(04.08.Of(2020), 04.08.Of(2020), Country.Uzbekistan, "0")
{TestName = "Uzbekistan passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=uz"};
yield return new TestCaseData(04.08.Of(2020), 04.08.Of(2020), Country.Turkey, "0")
{TestName = "Turkey passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=tr"};
{TestName = "Turkey passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=tr"};
yield return new TestCaseData(04.08.Of(2020), 04.08.Of(2020), Country.Latvia, "0")
{TestName = "Latvia passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=lv"};
}

[Test]
Expand Down
3 changes: 2 additions & 1 deletion isdayoff/Contract/Country.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum Country
Kazakhstan,
USA,
Uzbekistan,
Turkey
Turkey,
Latvia
}
}
2 changes: 2 additions & 0 deletions isdayoff/Core/IsDayOffApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ private static string GetCountryCode(Country country)
return "uz";
case Country.Turkey:
return "tr";
case Country.Latvia:
return "lv";
default:
throw new ArgumentOutOfRangeException(nameof(country), country, ErrorsMessages.UnknownCountry());
}
Expand Down

0 comments on commit 7c8b6c9

Please sign in to comment.