Skip to content

Add @DisplayName to Test Methods in Practice Exercises #2971 #2972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class SwiftSchedulingTest {
@Test
@DisplayName("NOW at 9 AM")
@DisplayName("NOW translates to two hours later")
void testNowAtNineAm() {
LocalDateTime meetingStart = LocalDateTime.parse("2012-02-13T09:00:00");
LocalDateTime expected = LocalDateTime.parse("2012-02-13T11:00:00");
Expand All @@ -20,7 +20,7 @@ void testNowAtNineAm() {

@Disabled("Remove to run test")
@Test
@DisplayName("ASAP before 1 PM")
@DisplayName("ASAP before one in the afternoon translates to today at five in the afternoon")
void testAsapBeforeOnePm() {
LocalDateTime meetingStart = LocalDateTime.parse("1999-06-03T09:45:00");
LocalDateTime expected = LocalDateTime.parse("1999-06-03T17:00:00");
Expand All @@ -32,7 +32,7 @@ void testAsapBeforeOnePm() {

@Disabled("Remove to run test")
@Test
@DisplayName("ASAP at 1 PM")
@DisplayName("ASAP at one in the afternoon translates to tomorrow at one in the afternoon")
void testAsapAtOnePm() {
LocalDateTime meetingStart = LocalDateTime.parse("2008-12-21T13:00:00");
LocalDateTime expected = LocalDateTime.parse("2008-12-22T13:00:00");
Expand All @@ -44,7 +44,7 @@ void testAsapAtOnePm() {

@Disabled("Remove to run test")
@Test
@DisplayName("ASAP after 1 PM")
@DisplayName("ASAP after one in the afternoon translates to tomorrow at one in the afternoon")
void testAsapAfterOnePm() {
LocalDateTime meetingStart = LocalDateTime.parse("2008-12-21T14:50:00");
LocalDateTime expected = LocalDateTime.parse("2008-12-22T13:00:00");
Expand All @@ -56,7 +56,7 @@ void testAsapAfterOnePm() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW on Monday")
@DisplayName("EOW on Monday translates to Friday at five in the afternoon")
void testEowOnMonday() {
LocalDateTime meetingStart = LocalDateTime.parse("2025-02-03T16:00:00");
LocalDateTime expected = LocalDateTime.parse("2025-02-07T17:00:00");
Expand All @@ -68,7 +68,7 @@ void testEowOnMonday() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW on Tuesday")
@DisplayName("EOW on Tuesday translates to Friday at five in the afternoon")
void testEowOnTuesday() {
LocalDateTime meetingStart = LocalDateTime.parse("1997-04-29T10:50:00");
LocalDateTime expected = LocalDateTime.parse("1997-05-02T17:00:00");
Expand All @@ -80,7 +80,7 @@ void testEowOnTuesday() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW on Wednesday")
@DisplayName("EOW on Wednesday translates to Friday at five in the afternoon")
void testEowOnWednesday() {
LocalDateTime meetingStart = LocalDateTime.parse("2005-09-14T11:00:00");
LocalDateTime expected = LocalDateTime.parse("2005-09-16T17:00:00");
Expand All @@ -92,7 +92,7 @@ void testEowOnWednesday() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW on Thursday")
@DisplayName("EOW on Thursday translates to Sunday at eight in the evening")
void testEowOnThursday() {
LocalDateTime meetingStart = LocalDateTime.parse("2011-05-19T08:30:00");
LocalDateTime expected = LocalDateTime.parse("2011-05-22T20:00:00");
Expand All @@ -104,7 +104,7 @@ void testEowOnThursday() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW on Friday")
@DisplayName("EOW on Friday translates to Sunday at eight in the evening")
void testEowOnFriday() {
LocalDateTime meetingStart = LocalDateTime.parse("2022-08-05T14:00:00");
LocalDateTime expected = LocalDateTime.parse("2022-08-07T20:00:00");
Expand All @@ -116,7 +116,7 @@ void testEowOnFriday() {

@Disabled("Remove to run test")
@Test
@DisplayName("EOW in leap year")
@DisplayName("EOW translates to leap day")
void testEowDuringLeapYear() {
LocalDateTime meetingStart = LocalDateTime.parse("2008-02-25T10:30:00");
LocalDateTime expected = LocalDateTime.parse("2008-02-29T17:00:00");
Expand All @@ -128,7 +128,7 @@ void testEowDuringLeapYear() {

@Disabled("Remove to run test")
@Test
@DisplayName("2M in January")
@DisplayName("2M before the second month of this year translates to the first workday of the second month of this year")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@DisplayName("2M before the second month of this year translates to the first workday of the second month of this year")
@DisplayName(
"2M before the second month of this year translates to the first workday of the second month of this year"
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was causing the Checkstyle error.
You can refer to CONTRIBUTING.md for guidance on how to run Checkstyle locally before creating a PR.

void test2MInJanuary() {
LocalDateTime meetingStart = LocalDateTime.parse("2007-01-02T14:15:00");
LocalDateTime expected = LocalDateTime.parse("2007-02-01T08:00:00");
Expand All @@ -140,7 +140,7 @@ void test2MInJanuary() {

@Disabled("Remove to run test")
@Test
@DisplayName("11M in November")
@DisplayName("11M in the eleventh month translates to the first workday of the eleventh month of next year")
void test11MInNovember() {
LocalDateTime meetingStart = LocalDateTime.parse("2013-11-21T15:30:00");
LocalDateTime expected = LocalDateTime.parse("2014-11-03T08:00:00");
Expand All @@ -152,7 +152,7 @@ void test11MInNovember() {

@Disabled("Remove to run test")
@Test
@DisplayName("4M in November")
@DisplayName("4M in the ninth month translates to the first workday of the fourth month of next year")
void test4MInNovember() {
LocalDateTime meetingStart = LocalDateTime.parse("2019-11-18T15:15:00");
LocalDateTime expected = LocalDateTime.parse("2020-04-01T08:00:00");
Expand All @@ -164,7 +164,7 @@ void test4MInNovember() {

@Disabled("Remove to run test")
@Test
@DisplayName("Q1 in Q1")
@DisplayName("Q1 in the first quarter translates to the last workday of the first quarter of this year")
void testQ1InQ1() {
LocalDateTime meetingStart = LocalDateTime.parse("2003-01-01T10:45:00");
LocalDateTime expected = LocalDateTime.parse("2003-03-31T08:00:00");
Expand All @@ -176,7 +176,7 @@ void testQ1InQ1() {

@Disabled("Remove to run test")
@Test
@DisplayName("Q4 in Q2")
@DisplayName("Q4 in the second quarter translates to the last workday of the fourth quarter of this year")
void testQ4InQ2() {
LocalDateTime meetingStart = LocalDateTime.parse("2001-04-09T09:00:00");
LocalDateTime expected = LocalDateTime.parse("2001-12-31T08:00:00");
Expand All @@ -188,7 +188,7 @@ void testQ4InQ2() {

@Disabled("Remove to run test")
@Test
@DisplayName("Q3 in Q4")
@DisplayName("Q3 in the fourth quarter translates to the last workday of the third quarter of next year")
void testQ3InQ4() {
LocalDateTime meetingStart = LocalDateTime.parse("2022-10-06T11:00:00");
LocalDateTime expected = LocalDateTime.parse("2023-09-29T08:00:00");
Expand Down
Loading