From d677c9fa80f98db0d2248bf1515e5a707f0d97e5 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Tue, 23 Sep 2025 09:25:05 +0530 Subject: [PATCH] matrix, meetup, micro-blog --- .../matrix/src/test/java/MatrixTest.java | 9 ++ .../meetup/src/test/java/MeetupTest.java | 96 +++++++++++++++++++ .../src/test/java/MicroBlogTest.java | 13 +++ 3 files changed, 118 insertions(+) diff --git a/exercises/practice/matrix/src/test/java/MatrixTest.java b/exercises/practice/matrix/src/test/java/MatrixTest.java index 3406ea8d7..5eb9ccfb4 100644 --- a/exercises/practice/matrix/src/test/java/MatrixTest.java +++ b/exercises/practice/matrix/src/test/java/MatrixTest.java @@ -1,4 +1,5 @@ import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -6,6 +7,7 @@ public class MatrixTest { @Test + @DisplayName("extract row from one number matrix") public void extractRowFromOneNumberMatrixTest() { String matrixAsString = "1"; int rowIndex = 1; @@ -18,6 +20,7 @@ public void extractRowFromOneNumberMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("can extract row") public void extractRowFromMatrixTest() { String matrixAsString = "1 2\n3 4"; int rowIndex = 2; @@ -30,6 +33,7 @@ public void extractRowFromMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("extract row where numbers have different widths") public void extractRowFromDiffWidthsMatrixTest() { String matrixAsString = "1 2\n10 20"; int rowIndex = 2; @@ -42,6 +46,7 @@ public void extractRowFromDiffWidthsMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("can extract row from non-square matrix with no corresponding column") public void extractRowFromNonSquareMatrixTest() { String matrixAsString = "1 2 3\n4 5 6\n7 8 9\n8 7 6"; int rowIndex = 4; @@ -54,6 +59,7 @@ public void extractRowFromNonSquareMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("extract column from one number matrix") public void extractColumnFromOneNumberMatrixTest() { String matrixAsString = "1"; int columnIndex = 1; @@ -66,6 +72,7 @@ public void extractColumnFromOneNumberMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("can extract column") public void extractColumnMatrixTest() { String matrixAsString = "1 2 3\n4 5 6\n7 8 9"; int columnIndex = 3; @@ -78,6 +85,7 @@ public void extractColumnMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("can extract column from non-square matrix with no corresponding row") public void extractColumnFromNonSquareMatrixTest() { String matrixAsString = "1 2 3 4\n5 6 7 8\n9 8 7 6"; int columnIndex = 4; @@ -90,6 +98,7 @@ public void extractColumnFromNonSquareMatrixTest() { @Disabled("Remove to run test") @Test + @DisplayName("extract column where numbers have different widths") public void extractColumnFromDiffWidthsMatrixTest() { String matrixAsString = "89 1903 3\n18 3 1\n9 4 800"; int columnIndex = 2; diff --git a/exercises/practice/meetup/src/test/java/MeetupTest.java b/exercises/practice/meetup/src/test/java/MeetupTest.java index 47eab9ad7..193eaa9ea 100644 --- a/exercises/practice/meetup/src/test/java/MeetupTest.java +++ b/exercises/practice/meetup/src/test/java/MeetupTest.java @@ -1,4 +1,5 @@ import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.DayOfWeek; @@ -9,6 +10,7 @@ public class MeetupTest { @Test + @DisplayName("when teenth Monday is the 13th, the first day of the teenth week") public void testMonteenthOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 13); Meetup meetup = new Meetup(5, 2013); @@ -17,6 +19,7 @@ public void testMonteenthOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Monday is the 19th, the last day of the teenth week") public void testMonteenthOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 19); Meetup meetup = new Meetup(8, 2013); @@ -25,6 +28,7 @@ public void testMonteenthOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Monday is some day in the middle of the teenth week") public void testMonteenthOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 16); Meetup meetup = new Meetup(9, 2013); @@ -33,6 +37,7 @@ public void testMonteenthOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Tuesday is the 19th, the last day of the teenth week") public void testTuesteenthOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 19); Meetup meetup = new Meetup(3, 2013); @@ -41,6 +46,7 @@ public void testTuesteenthOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Tuesday is some day in the middle of the teenth week") public void testTuesteenthOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 16); Meetup meetup = new Meetup(4, 2013); @@ -49,6 +55,7 @@ public void testTuesteenthOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Tuesday is the 13th, the first day of the teenth week") public void testTuesteenthOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 13); Meetup meetup = new Meetup(8, 2013); @@ -57,6 +64,7 @@ public void testTuesteenthOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Wednesday is some day in the middle of the teenth week") public void testWednesteenthOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 16); Meetup meetup = new Meetup(1, 2013); @@ -65,6 +73,7 @@ public void testWednesteenthOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Wednesday is the 13th, the first day of the teenth week") public void testWednesteenthOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 13); Meetup meetup = new Meetup(2, 2013); @@ -73,6 +82,7 @@ public void testWednesteenthOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Wednesday is the 19th, the last day of the teenth week") public void testWednesteenthOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 19); Meetup meetup = new Meetup(6, 2013); @@ -81,6 +91,7 @@ public void testWednesteenthOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Thursday is some day in the middle of the teenth week") public void testThursteenthOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 16); Meetup meetup = new Meetup(5, 2013); @@ -89,6 +100,7 @@ public void testThursteenthOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Thursday is the 13th, the first day of the teenth week") public void testThursteenthOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 13); Meetup meetup = new Meetup(6, 2013); @@ -97,6 +109,7 @@ public void testThursteenthOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Thursday is the 19th, the last day of the teenth week") public void testThursteenthOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 19); Meetup meetup = new Meetup(9, 2013); @@ -105,6 +118,7 @@ public void testThursteenthOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Friday is the 19th, the last day of the teenth week") public void testFriteenthOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 19); Meetup meetup = new Meetup(4, 2013); @@ -113,6 +127,7 @@ public void testFriteenthOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Friday is some day in the middle of the teenth week") public void testFriteenthOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 16); Meetup meetup = new Meetup(8, 2013); @@ -121,6 +136,7 @@ public void testFriteenthOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Friday is the 13th, the first day of the teenth week") public void testFriteenthOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 13); Meetup meetup = new Meetup(9, 2013); @@ -129,6 +145,7 @@ public void testFriteenthOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Saturday is some day in the middle of the teenth week") public void testSaturteenthOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 16); Meetup meetup = new Meetup(2, 2013); @@ -137,6 +154,7 @@ public void testSaturteenthOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Saturday is the 13th, the first day of the teenth week") public void testSaturteenthOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 13); Meetup meetup = new Meetup(4, 2013); @@ -145,6 +163,7 @@ public void testSaturteenthOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Saturday is the 19th, the last day of the teenth week") public void testSaturteenthOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 19); Meetup meetup = new Meetup(10, 2013); @@ -153,6 +172,7 @@ public void testSaturteenthOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Sunday is the 19th, the last day of the teenth week") public void testSunteenthOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 19); Meetup meetup = new Meetup(5, 2013); @@ -161,6 +181,7 @@ public void testSunteenthOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Sunday is some day in the middle of the teenth week") public void testSunteenthOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 16); Meetup meetup = new Meetup(6, 2013); @@ -169,6 +190,7 @@ public void testSunteenthOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when teenth Sunday is the 13th, the first day of the teenth week") public void testSunteenthOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 13); Meetup meetup = new Meetup(10, 2013); @@ -177,6 +199,7 @@ public void testSunteenthOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Monday is some day in the middle of the first week") public void testFirstMondayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 4); Meetup meetup = new Meetup(3, 2013); @@ -185,6 +208,7 @@ public void testFirstMondayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Monday is the 1st, the first day of the first week") public void testFirstMondayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 1); Meetup meetup = new Meetup(4, 2013); @@ -193,6 +217,7 @@ public void testFirstMondayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Tuesday is the 7th, the last day of the first week") public void testFirstTuesdayOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 7); Meetup meetup = new Meetup(5, 2013); @@ -201,6 +226,7 @@ public void testFirstTuesdayOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Tuesday is some day in the middle of the first week") public void testFirstTuesdayOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 4); Meetup meetup = new Meetup(6, 2013); @@ -209,6 +235,7 @@ public void testFirstTuesdayOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Wednesday is some day in the middle of the first week") public void testFirstWednesdayOfJuly2013() { LocalDate expected = LocalDate.of(2013, 7, 3); Meetup meetup = new Meetup(7, 2013); @@ -217,6 +244,7 @@ public void testFirstWednesdayOfJuly2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Wednesday is the 7th, the last day of the first week") public void testFirstWednesdayOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 7); Meetup meetup = new Meetup(8, 2013); @@ -225,6 +253,7 @@ public void testFirstWednesdayOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Thursday is some day in the middle of the first wee") public void testFirstThursdayOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 5); Meetup meetup = new Meetup(9, 2013); @@ -233,6 +262,7 @@ public void testFirstThursdayOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Thursday is another day in the middle of the first week") public void testFirstThursdayOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 3); Meetup meetup = new Meetup(10, 2013); @@ -241,6 +271,7 @@ public void testFirstThursdayOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Friday is the 1st, the first day of the first week") public void testFirstFridayOfNovember2013() { LocalDate expected = LocalDate.of(2013, 11, 1); Meetup meetup = new Meetup(11, 2013); @@ -249,6 +280,7 @@ public void testFirstFridayOfNovember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Friday is some day in the middle of the first week") public void testFirstFridayOfDecember2013() { LocalDate expected = LocalDate.of(2013, 12, 6); Meetup meetup = new Meetup(12, 2013); @@ -257,6 +289,7 @@ public void testFirstFridayOfDecember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Saturday is some day in the middle of the first week") public void testFirstSaturdayOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 5); Meetup meetup = new Meetup(1, 2013); @@ -265,6 +298,7 @@ public void testFirstSaturdayOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Saturday is another day in the middle of the first week") public void testFirstSaturdayOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 2); Meetup meetup = new Meetup(2, 2013); @@ -273,6 +307,7 @@ public void testFirstSaturdayOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Sunday is some day in the middle of the first week") public void testFirstSundayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 3); Meetup meetup = new Meetup(3, 2013); @@ -281,6 +316,7 @@ public void testFirstSundayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when first Sunday is the 7th, the last day of the first week") public void testFirstSundayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 7); Meetup meetup = new Meetup(4, 2013); @@ -289,6 +325,7 @@ public void testFirstSundayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Monday is some day in the middle of the second week") public void testSecondMondayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 11); Meetup meetup = new Meetup(3, 2013); @@ -297,6 +334,7 @@ public void testSecondMondayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Monday is the 8th, the first day of the second week") public void testSecondMondayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 8); Meetup meetup = new Meetup(4, 2013); @@ -305,6 +343,7 @@ public void testSecondMondayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Tuesday is the 14th, the last day of the second week") public void testSecondTuesdayOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 14); Meetup meetup = new Meetup(5, 2013); @@ -313,6 +352,7 @@ public void testSecondTuesdayOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Tuesday is some day in the middle of the second week") public void testSecondTuesdayOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 11); Meetup meetup = new Meetup(6, 2013); @@ -321,6 +361,7 @@ public void testSecondTuesdayOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Wednesday is some day in the middle of the second week") public void testSecondWednesdayOfJuly2013() { LocalDate expected = LocalDate.of(2013, 7, 10); Meetup meetup = new Meetup(7, 2013); @@ -329,6 +370,7 @@ public void testSecondWednesdayOfJuly2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Wednesday is the 14th, the last day of the second week") public void testSecondWednesdayOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 14); Meetup meetup = new Meetup(8, 2013); @@ -337,6 +379,7 @@ public void testSecondWednesdayOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Thursday is some day in the middle of the second week") public void testSecondThursdayOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 12); Meetup meetup = new Meetup(9, 2013); @@ -345,6 +388,7 @@ public void testSecondThursdayOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Thursday is another day in the middle of the second week") public void testSecondThursdayOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 10); Meetup meetup = new Meetup(10, 2013); @@ -353,6 +397,7 @@ public void testSecondThursdayOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Friday is the 8th, the first day of the second week") public void testSecondFridayOfNovember2013() { LocalDate expected = LocalDate.of(2013, 11, 8); Meetup meetup = new Meetup(11, 2013); @@ -361,6 +406,7 @@ public void testSecondFridayOfNovember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Friday is some day in the middle of the second week") public void testSecondFridayOfDecember2013() { LocalDate expected = LocalDate.of(2013, 12, 13); Meetup meetup = new Meetup(12, 2013); @@ -369,6 +415,7 @@ public void testSecondFridayOfDecember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Saturday is some day in the middle of the second week") public void testSecondSaturdayOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 12); Meetup meetup = new Meetup(1, 2013); @@ -377,6 +424,7 @@ public void testSecondSaturdayOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Saturday is another day in the middle of the second week") public void testSecondSaturdayOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 9); Meetup meetup = new Meetup(2, 2013); @@ -385,6 +433,7 @@ public void testSecondSaturdayOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Sunday is some day in the middle of the second week") public void testSecondSundayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 10); Meetup meetup = new Meetup(3, 2013); @@ -393,6 +442,7 @@ public void testSecondSundayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when second Sunday is the 14th, the last day of the second week") public void testSecondSundayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 14); Meetup meetup = new Meetup(4, 2013); @@ -401,6 +451,7 @@ public void testSecondSundayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Monday is some day in the middle of the third week") public void testThirdMondayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 18); Meetup meetup = new Meetup(3, 2013); @@ -409,6 +460,7 @@ public void testThirdMondayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Monday is the 15th, the first day of the third week") public void testThirdMondayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 15); Meetup meetup = new Meetup(4, 2013); @@ -417,6 +469,7 @@ public void testThirdMondayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Tuesday is the 21st, the last day of the third week") public void testThirdTuesdayOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 21); Meetup meetup = new Meetup(5, 2013); @@ -425,6 +478,7 @@ public void testThirdTuesdayOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Tuesday is some day in the middle of the third week") public void testThirdTuesdayOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 18); Meetup meetup = new Meetup(6, 2013); @@ -433,6 +487,7 @@ public void testThirdTuesdayOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Wednesday is some day in the middle of the third week") public void testThirdWednesdayOfJuly2013() { LocalDate expected = LocalDate.of(2013, 7, 17); Meetup meetup = new Meetup(7, 2013); @@ -441,6 +496,7 @@ public void testThirdWednesdayOfJuly2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Wednesday is the 21st, the last day of the third week") public void testThirdWednesdayOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 21); Meetup meetup = new Meetup(8, 2013); @@ -449,6 +505,7 @@ public void testThirdWednesdayOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Thursday is some day in the middle of the third week") public void testThirdThursdayOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 19); Meetup meetup = new Meetup(9, 2013); @@ -457,6 +514,7 @@ public void testThirdThursdayOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Thursday is another day in the middle of the third week") public void testThirdThursdayOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 17); Meetup meetup = new Meetup(10, 2013); @@ -465,6 +523,7 @@ public void testThirdThursdayOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Friday is the 15th, the first day of the third week") public void testThirdFridayOfNovember2013() { LocalDate expected = LocalDate.of(2013, 11, 15); Meetup meetup = new Meetup(11, 2013); @@ -473,6 +532,7 @@ public void testThirdFridayOfNovember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Friday is some day in the middle of the third week") public void testThirdFridayOfDecember2013() { LocalDate expected = LocalDate.of(2013, 12, 20); Meetup meetup = new Meetup(12, 2013); @@ -481,6 +541,7 @@ public void testThirdFridayOfDecember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Saturday is some day in the middle of the third week") public void testThirdSaturdayOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 19); Meetup meetup = new Meetup(1, 2013); @@ -489,6 +550,7 @@ public void testThirdSaturdayOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Saturday is another day in the middle of the third week") public void testThirdSaturdayOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 16); Meetup meetup = new Meetup(2, 2013); @@ -497,6 +559,7 @@ public void testThirdSaturdayOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Sunday is some day in the middle of the third week") public void testThirdSundayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 17); Meetup meetup = new Meetup(3, 2013); @@ -505,6 +568,7 @@ public void testThirdSundayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when third Sunday is the 21st, the last day of the third week") public void testThirdSundayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 21); Meetup meetup = new Meetup(4, 2013); @@ -513,6 +577,7 @@ public void testThirdSundayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Monday is some day in the middle of the fourth week") public void testFourthMondayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 25); Meetup meetup = new Meetup(3, 2013); @@ -521,6 +586,7 @@ public void testFourthMondayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Monday is the 22nd, the first day of the fourth week") public void testFourthMondayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 22); Meetup meetup = new Meetup(4, 2013); @@ -529,6 +595,7 @@ public void testFourthMondayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Tuesday is the 28th, the last day of the fourth week") public void testFourthTuesdayOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 28); Meetup meetup = new Meetup(5, 2013); @@ -537,6 +604,7 @@ public void testFourthTuesdayOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Tuesday is some day in the middle of the fourth week") public void testFourthTuesdayOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 25); Meetup meetup = new Meetup(6, 2013); @@ -545,6 +613,7 @@ public void testFourthTuesdayOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Wednesday is some day in the middle of the fourth week") public void testFourthWednesdayOfJuly2013() { LocalDate expected = LocalDate.of(2013, 7, 24); Meetup meetup = new Meetup(7, 2013); @@ -553,6 +622,7 @@ public void testFourthWednesdayOfJuly2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Wednesday is the 28th, the last day of the fourth week") public void testFourthWednesdayOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 28); Meetup meetup = new Meetup(8, 2013); @@ -561,6 +631,7 @@ public void testFourthWednesdayOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Thursday is some day in the middle of the fourth week") public void testFourthThursdayOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 26); Meetup meetup = new Meetup(9, 2013); @@ -569,6 +640,7 @@ public void testFourthThursdayOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Thursday is another day in the middle of the fourth week") public void testFourthThursdayOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 24); Meetup meetup = new Meetup(10, 2013); @@ -577,6 +649,7 @@ public void testFourthThursdayOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Friday is the 22nd, the first day of the fourth week") public void testFourthFridayOfNovember2013() { LocalDate expected = LocalDate.of(2013, 11, 22); Meetup meetup = new Meetup(11, 2013); @@ -585,6 +658,7 @@ public void testFourthFridayOfNovember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Friday is some day in the middle of the fourth week") public void testFourthFridayOfDecember2013() { LocalDate expected = LocalDate.of(2013, 12, 27); Meetup meetup = new Meetup(12, 2013); @@ -593,6 +667,7 @@ public void testFourthFridayOfDecember2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Saturday is some day in the middle of the fourth week") public void testFourthSaturdayOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 26); Meetup meetup = new Meetup(1, 2013); @@ -601,6 +676,7 @@ public void testFourthSaturdayOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Saturday is another day in the middle of the fourth week") public void testFourthSaturdayOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 23); Meetup meetup = new Meetup(2, 2013); @@ -609,6 +685,7 @@ public void testFourthSaturdayOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Sunday is some day in the middle of the fourth week") public void testFourthSundayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 24); Meetup meetup = new Meetup(3, 2013); @@ -617,6 +694,7 @@ public void testFourthSundayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("when fourth Sunday is the 28th, the last day of the fourth week") public void testFourthSundayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 28); Meetup meetup = new Meetup(4, 2013); @@ -625,6 +703,7 @@ public void testFourthSundayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Monday in a month with four Mondays") public void testLastMondayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 25); Meetup meetup = new Meetup(3, 2013); @@ -633,6 +712,7 @@ public void testLastMondayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Monday in a month with five Mondays") public void testLastMondayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 29); Meetup meetup = new Meetup(4, 2013); @@ -641,6 +721,7 @@ public void testLastMondayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Tuesday in a month with four Tuesdays") public void testLastTuesdayOfMay2013() { LocalDate expected = LocalDate.of(2013, 5, 28); Meetup meetup = new Meetup(5, 2013); @@ -649,6 +730,7 @@ public void testLastTuesdayOfMay2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Tuesday in another month with four Tuesdays") public void testLastTuesdayOfJune2013() { LocalDate expected = LocalDate.of(2013, 6, 25); Meetup meetup = new Meetup(6, 2013); @@ -657,6 +739,7 @@ public void testLastTuesdayOfJune2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Wednesday in a month with five Wednesdays") public void testLastWednesdayOfJuly2013() { LocalDate expected = LocalDate.of(2013, 7, 31); Meetup meetup = new Meetup(7, 2013); @@ -665,6 +748,7 @@ public void testLastWednesdayOfJuly2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Wednesday in a month with four Wednesdays") public void testLastWednesdayOfAugust2013() { LocalDate expected = LocalDate.of(2013, 8, 28); Meetup meetup = new Meetup(8, 2013); @@ -673,6 +757,7 @@ public void testLastWednesdayOfAugust2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Thursday in a month with four Thursdays") public void testLastThursdayOfSeptember2013() { LocalDate expected = LocalDate.of(2013, 9, 26); Meetup meetup = new Meetup(9, 2013); @@ -681,6 +766,7 @@ public void testLastThursdayOfSeptember2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Thursday in a month with five Thursdays") public void testLastThursdayOfOctober2013() { LocalDate expected = LocalDate.of(2013, 10, 31); Meetup meetup = new Meetup(10, 2013); @@ -689,6 +775,7 @@ public void testLastThursdayOfOctober2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Friday in a month with five Fridays") public void testLastFridayOfNovember2013() { LocalDate expected = LocalDate.of(2013, 11, 29); Meetup meetup = new Meetup(11, 2013); @@ -697,6 +784,7 @@ public void testLastFridayOfNovember2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Friday in a month with four Fridays") public void testLastFridayOfDecember2013() { LocalDate expected = LocalDate.of(2013, 12, 27); Meetup meetup = new Meetup(12, 2013); @@ -705,6 +793,7 @@ public void testLastFridayOfDecember2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Saturday in a month with four Saturdays") public void testLastSaturdayOfJanuary2013() { LocalDate expected = LocalDate.of(2013, 1, 26); Meetup meetup = new Meetup(1, 2013); @@ -713,6 +802,7 @@ public void testLastSaturdayOfJanuary2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Saturday in another month with four Saturdays") public void testLastSaturdayOfFebruary2013() { LocalDate expected = LocalDate.of(2013, 2, 23); Meetup meetup = new Meetup(2, 2013); @@ -721,6 +811,7 @@ public void testLastSaturdayOfFebruary2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Sunday in a month with five Sundays") public void testLastSundayOfMarch2013() { LocalDate expected = LocalDate.of(2013, 3, 31); Meetup meetup = new Meetup(3, 2013); @@ -729,6 +820,7 @@ public void testLastSundayOfMarch2013() { @Disabled("Remove to run test") @Test + @DisplayName("last Sunday in a month with four Sundays") public void testLastSundayOfApril2013() { LocalDate expected = LocalDate.of(2013, 4, 28); Meetup meetup = new Meetup(4, 2013); @@ -737,6 +829,7 @@ public void testLastSundayOfApril2013() { @Disabled("Remove to run test") @Test + @DisplayName("when last Wednesday in February in a leap year is the 29th") public void testLastWednesdayOfFebruary2012() { LocalDate expected = LocalDate.of(2012, 2, 29); Meetup meetup = new Meetup(2, 2012); @@ -745,6 +838,7 @@ public void testLastWednesdayOfFebruary2012() { @Disabled("Remove to run test") @Test + @DisplayName("last Wednesday in December that is also the last day of the year") public void testLastWednesdayOfDecember2014() { LocalDate expected = LocalDate.of(2014, 12, 31); Meetup meetup = new Meetup(12, 2014); @@ -753,6 +847,7 @@ public void testLastWednesdayOfDecember2014() { @Disabled("Remove to run test") @Test + @DisplayName("when last Sunday in February in a non-leap year is not the 29th") public void testLastSundayOfFebruary2015() { LocalDate expected = LocalDate.of(2015, 2, 22); Meetup meetup = new Meetup(2, 2015); @@ -761,6 +856,7 @@ public void testLastSundayOfFebruary2015() { @Disabled("Remove to run test") @Test + @DisplayName("when first Friday is the 7th, the last day of the first week") public void testFirstFridayOfDecember2012() { LocalDate expected = LocalDate.of(2012, 12, 7); Meetup meetup = new Meetup(12, 2012); diff --git a/exercises/practice/micro-blog/src/test/java/MicroBlogTest.java b/exercises/practice/micro-blog/src/test/java/MicroBlogTest.java index b22106041..46ced92d6 100644 --- a/exercises/practice/micro-blog/src/test/java/MicroBlogTest.java +++ b/exercises/practice/micro-blog/src/test/java/MicroBlogTest.java @@ -1,4 +1,5 @@ import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -8,6 +9,7 @@ public class MicroBlogTest { private final MicroBlog microBlog = new MicroBlog(); @Test + @DisplayName("English language short") public void englishLanguageShort() { String expected = "Hi"; assertThat(microBlog.truncate("Hi")).isEqualTo(expected); @@ -15,6 +17,7 @@ public void englishLanguageShort() { @Disabled("Remove to run test") @Test + @DisplayName("English language long") public void englishLanguageLong() { String expected = "Hello"; assertThat(microBlog.truncate("Hello there")).isEqualTo(expected); @@ -22,6 +25,7 @@ public void englishLanguageLong() { @Disabled("Remove to run test") @Test + @DisplayName("German language short (broth)") public void germanLanguageShort_broth() { String expected = "brühe"; assertThat(microBlog.truncate("brühe")).isEqualTo(expected); @@ -29,6 +33,7 @@ public void germanLanguageShort_broth() { @Disabled("Remove to run test") @Test + @DisplayName("German language long (bear carpet → beards)") public void germanLanguageLong_bearCarpet_to_beards() { String expected = "Bärte"; assertThat(microBlog.truncate("Bärteppich")).isEqualTo(expected); @@ -36,6 +41,7 @@ public void germanLanguageLong_bearCarpet_to_beards() { @Disabled("Remove to run test") @Test + @DisplayName("Bulgarian language short (good)") public void bulgarianLanguageShort_good() { String expected = "Добър"; assertThat(microBlog.truncate("Добър")).isEqualTo(expected); @@ -43,6 +49,7 @@ public void bulgarianLanguageShort_good() { @Disabled("Remove to run test") @Test + @DisplayName("Greek language short (health)") public void greekLanguageShort_health() { String expected = "υγειά"; assertThat(microBlog.truncate("υγειά")).isEqualTo(expected); @@ -50,6 +57,7 @@ public void greekLanguageShort_health() { @Disabled("Remove to run test") @Test + @DisplayName("Maths short") public void mathsShort() { String expected = "a=πr²"; assertThat(microBlog.truncate("a=πr²")).isEqualTo(expected); @@ -57,6 +65,7 @@ public void mathsShort() { @Disabled("Remove to run test") @Test + @DisplayName("Maths long") public void mathsLong() { String expected = "∅⊊ℕ⊊ℤ"; assertThat(microBlog.truncate("∅⊊ℕ⊊ℤ⊊ℚ⊊ℝ⊊ℂ")).isEqualTo(expected); @@ -64,6 +73,7 @@ public void mathsLong() { @Disabled("Remove to run test") @Test + @DisplayName("English and emoji short") public void englishAndEmojiShort() { String expected = "Fly 🛫"; assertThat(microBlog.truncate("Fly 🛫")).isEqualTo(expected); @@ -71,6 +81,7 @@ public void englishAndEmojiShort() { @Disabled("Remove to run test") @Test + @DisplayName("Emoji short") public void emojiShort() { String expected = "💇"; assertThat(microBlog.truncate("💇")).isEqualTo(expected); @@ -78,6 +89,7 @@ public void emojiShort() { @Disabled("Remove to run test") @Test + @DisplayName("Emoji long") public void emojiLong() { String expected = "❄🌡🤧🤒🏥"; assertThat(microBlog.truncate("❄🌡🤧🤒🏥🕰😀")).isEqualTo(expected); @@ -85,6 +97,7 @@ public void emojiLong() { @Disabled("Remove to run test") @Test + @DisplayName("Royal Flush?") public void royalFlush() { String expected = "🃎🂸🃅🃋🃍"; assertThat(microBlog.truncate("🃎🂸🃅🃋🃍🃁🃊")).isEqualTo(expected);