diff --git a/exercises/practice/transpose/src/test/java/TransposeTest.java b/exercises/practice/transpose/src/test/java/TransposeTest.java index ad8f95f29..8a4b18686 100644 --- a/exercises/practice/transpose/src/test/java/TransposeTest.java +++ b/exercises/practice/transpose/src/test/java/TransposeTest.java @@ -1,6 +1,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; @@ -13,12 +14,14 @@ public void setup() { } @Test + @DisplayName("empty string") public void emptyString() { assertThat(transpose.transpose("")).isEqualTo(""); } @Disabled("Remove to run test") @Test + @DisplayName("two characters in a row") public void twoCharactersInARow() { assertThat(transpose.transpose("A1")) .isEqualTo( @@ -28,6 +31,7 @@ public void twoCharactersInARow() { @Disabled("Remove to run test") @Test + @DisplayName("two characters in a column") public void twoCharactersInAColumn() { assertThat( transpose.transpose( @@ -38,6 +42,7 @@ public void twoCharactersInAColumn() { @Disabled("Remove to run test") @Test + @DisplayName("simple") public void simple() { assertThat( transpose.transpose( @@ -51,6 +56,7 @@ public void simple() { @Disabled("Remove to run test") @Test + @DisplayName("single line") public void singleLine() { assertThat(transpose.transpose("Single line.")) .isEqualTo( @@ -70,6 +76,7 @@ public void singleLine() { @Disabled("Remove to run test") @Test + @DisplayName("first line longer than second line") public void firstLineLongerThanSecondLine() { assertThat( transpose.transpose( @@ -96,6 +103,7 @@ public void firstLineLongerThanSecondLine() { @Disabled("Remove to run test") @Test + @DisplayName("second line longer than first line") public void secondLineLongerThanFirstLine() { assertThat( transpose.transpose( @@ -122,6 +130,7 @@ public void secondLineLongerThanFirstLine() { @Disabled("Remove to run test") @Test + @DisplayName("mixed line length") public void mixedLineLength() { assertThat( transpose.transpose( @@ -151,6 +160,7 @@ public void mixedLineLength() { @Disabled("Remove to run test") @Test + @DisplayName("square") public void square() { assertThat( transpose.transpose( @@ -169,6 +179,7 @@ public void square() { @Disabled("Remove to run test") @Test + @DisplayName("rectangle") public void rectangle() { assertThat( transpose.transpose( @@ -189,6 +200,7 @@ public void rectangle() { @Disabled("Remove to run test") @Test + @DisplayName("triangle") public void triangle() { assertThat( transpose.transpose( @@ -209,6 +221,7 @@ public void triangle() { @Disabled("Remove to run test") @Test + @DisplayName("jagged triangle") public void jaggedTriangle() { assertThat( transpose.transpose( diff --git a/exercises/practice/triangle/src/test/java/TriangleTest.java b/exercises/practice/triangle/src/test/java/TriangleTest.java index bd6ad663a..e7dc8f630 100644 --- a/exercises/practice/triangle/src/test/java/TriangleTest.java +++ b/exercises/practice/triangle/src/test/java/TriangleTest.java @@ -3,10 +3,12 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; public class TriangleTest { @Test + @DisplayName("equilateral triangle") public void equilateralTrianglesHaveEqualSides() throws TriangleException { Triangle triangle = new Triangle(2, 2, 2); @@ -15,6 +17,7 @@ public void equilateralTrianglesHaveEqualSides() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("any side is unequal") public void trianglesWithOneUnequalSideAreNotEquilateral() throws TriangleException { Triangle triangle = new Triangle(2, 3, 2); @@ -23,6 +26,7 @@ public void trianglesWithOneUnequalSideAreNotEquilateral() throws TriangleExcept @Disabled("Remove to run test") @Test + @DisplayName("no sides are equal") public void trianglesWithNoEqualSidesAreNotEquilateral() throws TriangleException { Triangle triangle = new Triangle(5, 4, 6); @@ -31,12 +35,14 @@ public void trianglesWithNoEqualSidesAreNotEquilateral() throws TriangleExceptio @Disabled("Remove to run test") @Test + @DisplayName("all zero sides is not a triangle") public void trianglesWithNoSizeAreIllegal() { assertThatExceptionOfType(TriangleException.class).isThrownBy(() -> new Triangle(0, 0, 0)); } @Disabled("Remove to run test") @Test + @DisplayName("sides may be floats") public void verySmallTrianglesCanBeEquilateral() throws TriangleException { Triangle triangle = new Triangle(0.5, 0.5, 0.5); @@ -45,6 +51,7 @@ public void verySmallTrianglesCanBeEquilateral() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("last two sides are equal") public void isoscelesTrianglesHaveLastTwoSidesEqual() throws TriangleException { Triangle triangle = new Triangle(3, 4, 4); @@ -53,6 +60,7 @@ public void isoscelesTrianglesHaveLastTwoSidesEqual() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("first two sides are equal") public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws TriangleException { Triangle triangle = new Triangle(4, 4, 3); @@ -61,6 +69,7 @@ public void isoscelesTrianglesHaveTwoFirstSidesEqual() throws TriangleException @Disabled("Remove to run test") @Test + @DisplayName("first and last sides are equal") public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws TriangleException { Triangle triangle = new Triangle(4, 3, 4); @@ -69,6 +78,7 @@ public void isoscelesTrianglesHaveFirstAndLastSidesEqual() throws TriangleExcept @Disabled("Remove to run test") @Test + @DisplayName("equilateral triangles are also isosceles") public void equilateralTrianglesAreAlsoIsosceles() throws TriangleException { Triangle triangle = new Triangle(4, 4, 4); @@ -77,6 +87,7 @@ public void equilateralTrianglesAreAlsoIsosceles() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("no sides are equal") public void noSidesAreEqualCantBeIsoceles() throws TriangleException { Triangle triangle = new Triangle(2, 3, 4); @@ -85,24 +96,28 @@ public void noSidesAreEqualCantBeIsoceles() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("first triangle inequality violation") public void firstTriangleInequalityViolation() { assertThatExceptionOfType(TriangleException.class).isThrownBy(() -> new Triangle(1, 1, 3)); } @Disabled("Remove to run test") @Test + @DisplayName("second triangle inequality violation") public void secondTriangleInequalityViolation() { assertThatExceptionOfType(TriangleException.class).isThrownBy(() -> new Triangle(1, 3, 1)); } @Disabled("Remove to run test") @Test + @DisplayName("third triangle inequality violation") public void thirdTriangleInequalityViolation() { assertThatExceptionOfType(TriangleException.class).isThrownBy(() -> new Triangle(3, 1, 1)); } @Disabled("Remove to run test") @Test + @DisplayName("sides may be floats") public void verySmallTrianglesCanBeIsosceles() throws TriangleException { Triangle triangle = new Triangle(0.5, 0.4, 0.5); @@ -111,6 +126,7 @@ public void verySmallTrianglesCanBeIsosceles() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("no sides are equal") public void scaleneTrianglesHaveNoEqualSides() throws TriangleException { Triangle triangle = new Triangle(5, 4, 6); @@ -119,6 +135,7 @@ public void scaleneTrianglesHaveNoEqualSides() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("all sides are equal") public void allSidesEqualAreNotScalene() throws TriangleException { Triangle triangle = new Triangle(4, 4, 4); @@ -127,6 +144,7 @@ public void allSidesEqualAreNotScalene() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("first and second sides are equal") public void twoSidesEqualAreNotScalene() throws TriangleException { Triangle triangle = new Triangle(4, 4, 3); @@ -135,6 +153,7 @@ public void twoSidesEqualAreNotScalene() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("first and third sides are equal") public void firstAndThirdSidesAreEqualAreNotScalene() throws TriangleException { Triangle triangle = new Triangle(3, 4, 3); @@ -143,6 +162,7 @@ public void firstAndThirdSidesAreEqualAreNotScalene() throws TriangleException { @Disabled("Remove to run test") @Test + @DisplayName("second and third sides are equal") public void secondAndThirdSidesAreEqualAreNotScalene() throws TriangleException { Triangle triangle = new Triangle(4, 3, 3); @@ -151,12 +171,14 @@ public void secondAndThirdSidesAreEqualAreNotScalene() throws TriangleException @Disabled("Remove to run test") @Test + @DisplayName("may not violate triangle inequality") public void mayNotViolateTriangleInequality() { assertThatExceptionOfType(TriangleException.class).isThrownBy(() -> new Triangle(7, 3, 2)); } @Disabled("Remove to run test") @Test + @DisplayName("sides may be floats") public void verySmallTrianglesCanBeScalene() throws TriangleException { Triangle triangle = new Triangle(0.5, 0.4, 0.6); diff --git a/exercises/practice/twelve-days/src/test/java/TwelveDaysTest.java b/exercises/practice/twelve-days/src/test/java/TwelveDaysTest.java index d046235eb..a6827ee51 100644 --- a/exercises/practice/twelve-days/src/test/java/TwelveDaysTest.java +++ b/exercises/practice/twelve-days/src/test/java/TwelveDaysTest.java @@ -1,5 +1,6 @@ import org.junit.jupiter.api.BeforeEach; 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; @@ -13,6 +14,7 @@ public void setup() { } @Test + @DisplayName("first day a partridge in a pear tree") public void testVerseOne() { String expectedVerseOne = "On the first day of Christmas my true love gave to me: " + "a Partridge in a Pear Tree.\n"; @@ -21,6 +23,7 @@ public void testVerseOne() { @Disabled("Remove to run test") @Test + @DisplayName("second day two turtle doves") public void testVerseTwo() { String expectedVerseTwo = "On the second day of Christmas my true love gave to me: two Turtle Doves, " + "and a Partridge in a Pear Tree.\n"; @@ -29,6 +32,7 @@ public void testVerseTwo() { @Disabled("Remove to run test") @Test + @DisplayName("third day three french hens") public void testVerseThree() { String expectedVerseThree = "On the third day of Christmas my true love gave to me: three French Hens, " + "two Turtle Doves, and a Partridge in a Pear Tree.\n"; @@ -37,6 +41,7 @@ public void testVerseThree() { @Disabled("Remove to run test") @Test + @DisplayName("fourth day four calling birds") public void testVerseFour() { String expectedVerseFour = "On the fourth day of Christmas my true love gave to me: four Calling Birds, " + "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; @@ -45,6 +50,7 @@ public void testVerseFour() { @Disabled("Remove to run test") @Test + @DisplayName("fifth day five gold rings") public void testVerseFive() { String expectedVerseFive = "On the fifth day of Christmas my true love gave to me: five Gold Rings, " + "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n"; @@ -53,6 +59,7 @@ public void testVerseFive() { @Disabled("Remove to run test") @Test + @DisplayName("sixth day six geese-a-laying") public void testVerseSix() { String expectedVerseSix = "On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, " + "five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " + @@ -62,6 +69,7 @@ public void testVerseSix() { @Disabled("Remove to run test") @Test + @DisplayName("seventh day seven swans-a-swimming") public void testVerseSeven() { String expectedVerseSeven = "On the seventh day of Christmas my true love gave to me: " + "seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, " + @@ -71,6 +79,7 @@ public void testVerseSeven() { @Disabled("Remove to run test") @Test + @DisplayName("eighth day eight maids-a-milking") public void testVerseEight() { String expectedVerseEight = "On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking," + " seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " + @@ -80,6 +89,7 @@ public void testVerseEight() { @Disabled("Remove to run test") @Test + @DisplayName("ninth day nine ladies dancing") public void testVerseNine() { String expectedVerseNine = "On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, " + "eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " + @@ -89,6 +99,7 @@ public void testVerseNine() { @Disabled("Remove to run test") @Test + @DisplayName("tenth day ten lords-a-leaping") public void testVerseTen() { String expectedVerseTen = "On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, " + "nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, " + @@ -99,6 +110,7 @@ public void testVerseTen() { @Disabled("Remove to run test") @Test + @DisplayName("eleventh day eleven pipers piping") public void testVerseEleven() { String expectedVerseEleven = "On the eleventh day of Christmas my true love gave to me: " + "eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " + @@ -109,6 +121,7 @@ public void testVerseEleven() { @Disabled("Remove to run test") @Test + @DisplayName("twelfth day twelve drummers drumming") public void testVerseTwelve() { String expectedVerseTwelve = "On the twelfth day of Christmas my true love gave to me: " + "twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, " + @@ -119,6 +132,7 @@ public void testVerseTwelve() { @Disabled("Remove to run test") @Test + @DisplayName("recites first three verses of the song") public void testFirstThreeVerses() { String expectedVersesOneToThree = "On the first day of Christmas my true love gave to me: " + "a Partridge in a Pear Tree.\n\n" + @@ -131,6 +145,7 @@ public void testFirstThreeVerses() { @Disabled("Remove to run test") @Test + @DisplayName("recites three verses from the middle of the song") public void testFourthToSixthVerses() { String expectedVersesFourToSix = "On the fourth day of Christmas my true love gave to me: " + "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n\n" + @@ -143,6 +158,7 @@ public void testFourthToSixthVerses() { @Disabled("Remove to run test") @Test + @DisplayName("recites the whole song") public void testSingWholeSong() { String expectedSong = "On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.\n" + "\n" +