Skip to content

Commit 0e35718

Browse files
authored
swift scheduling: add missing Q2 test case (#3159)
Add the missing test case from problem specifications for the swift scheduling exercise. The case covers a Q2 delivery that starts in the last month of the second quarter and translates to the last workday of the second quarter of this year. The tests toml file is synced with configlet and the new test is added to the JUnit test suite.
1 parent f1b22a3 commit 0e35718

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎exercises/practice/swift-scheduling/.meta/tests.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ description = "Q4 in the second quarter translates to the last workday of the fo
5656

5757
[c920886c-44ad-4d34-a156-dc4176186581]
5858
description = "Q3 in the fourth quarter translates to the last workday of the third quarter of next year"
59+
60+
[7c8f1616-be62-417e-bbd5-a60fa743eccc]
61+
description = "Q2 starting in the last month of the second quarter translates to the last workday of the second quarter of this year"

‎exercises/practice/swift-scheduling/src/test/java/SwiftSchedulingTest.java‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,18 @@ void testQ3InQ4() {
199199

200200
assertThat(actual).isEqualTo(expected);
201201
}
202+
203+
@Disabled("Remove to run test")
204+
@Test
205+
@DisplayName(
206+
"Q2 starting in the last month of the second quarter translates to the last workday of the second quarter of this year"
207+
)
208+
void testQ2InQ2() {
209+
LocalDateTime meetingStart = LocalDateTime.parse("2019-06-15T09:50:00");
210+
LocalDateTime expected = LocalDateTime.parse("2019-06-28T08:00:00");
211+
212+
LocalDateTime actual = SwiftScheduling.convertToDeliveryDate(meetingStart, "Q2");
213+
214+
assertThat(actual).isEqualTo(expected);
215+
}
202216
}

0 commit comments

Comments
 (0)