From ec0ef275915ccaaa97fc07a02db5f83c247272d8 Mon Sep 17 00:00:00 2001 From: Danila Chervonny Date: Sun, 6 Jun 2021 17:51:34 +0300 Subject: [PATCH] close #3 (#4) --- isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs | 4 ++++ isdayoff/Contract/Country.cs | 7 ++++--- isdayoff/Core/IsDayOffApiClient.cs | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs b/isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs index a3a03ab..fb75987 100644 --- a/isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs +++ b/isdayoff.Tests/IsDayOffApiClientTests/WhenGetData.cs @@ -67,6 +67,10 @@ private static IEnumerable UrlConstructionTestData() {TestName = "Ukraine passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=ua"}; yield return new TestCaseData(04.08.Of(2020), 04.08.Of(2020), Country.USA, "0") {TestName = "USA passes correctly", ExpectedResult = $"{ApiBaseUrlStub}getdata?date1=20200804&date2=20200804&cc=us"}; + 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"}; } [Test] diff --git a/isdayoff/Contract/Country.cs b/isdayoff/Contract/Country.cs index 6379156..86c368e 100644 --- a/isdayoff/Contract/Country.cs +++ b/isdayoff/Contract/Country.cs @@ -1,5 +1,4 @@ - -namespace isdayoff.Contract +namespace isdayoff.Contract { public enum Country { @@ -7,6 +6,8 @@ public enum Country Belarus, Ukraine, Kazakhstan, - USA + USA, + Uzbekistan, + Turkey } } \ No newline at end of file diff --git a/isdayoff/Core/IsDayOffApiClient.cs b/isdayoff/Core/IsDayOffApiClient.cs index c804e77..e0439b2 100644 --- a/isdayoff/Core/IsDayOffApiClient.cs +++ b/isdayoff/Core/IsDayOffApiClient.cs @@ -120,6 +120,10 @@ private static string GetCountryCode(Country country) return "kz"; case Country.USA: return "us"; + case Country.Uzbekistan: + return "uz"; + case Country.Turkey: + return "tr"; default: throw new ArgumentOutOfRangeException(nameof(country), country, ErrorsMessages.UnknownCountry()); }