diff --git a/exercises/practice/complex-numbers/src/test/java/ComplexNumberTest.java b/exercises/practice/complex-numbers/src/test/java/ComplexNumberTest.java index 1d479ea68..d9edc378a 100644 --- a/exercises/practice/complex-numbers/src/test/java/ComplexNumberTest.java +++ b/exercises/practice/complex-numbers/src/test/java/ComplexNumberTest.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; @@ -24,6 +25,7 @@ private void assertComplexNumbersEqual(ComplexNumber c1, ComplexNumber c2) { // Tests @Test + @DisplayName("Real part of a purely real number") public void testRealPartOfPurelyRealNumber() { double expected = 1.0; double actual = new ComplexNumber(1.0, 0).getReal(); @@ -32,6 +34,7 @@ public void testRealPartOfPurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Real part of a purely imaginary number") public void testRealPartOfPurelyImaginaryNumber() { double expected = 0.0; double actual = new ComplexNumber(0, 1.0).getReal(); @@ -40,6 +43,7 @@ public void testRealPartOfPurelyImaginaryNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Real part of a number with real and imaginary part") public void testRealPartOfNumberWithRealAndImaginaryParts() { double expected = 1.0; double actual = new ComplexNumber(1.0, 2.0).getReal(); @@ -48,6 +52,7 @@ public void testRealPartOfNumberWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Imaginary part of a purely real number") public void testImaginaryPartOfPurelyRealNumber() { double expected = 0.0; double actual = new ComplexNumber(1.0, 0).getImaginary(); @@ -56,6 +61,7 @@ public void testImaginaryPartOfPurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Imaginary part of a purely imaginary number") public void testImaginaryPartOfPurelyImaginaryNumber() { double expected = 1.0; double actual = new ComplexNumber(0, 1.0).getImaginary(); @@ -64,6 +70,7 @@ public void testImaginaryPartOfPurelyImaginaryNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Imaginary part of a number with real and imaginary part") public void testImaginaryPartOfNumberWithRealAndImaginaryParts() { double expected = 2.0; double actual = new ComplexNumber(1.0, 2.0).getImaginary(); @@ -72,6 +79,7 @@ public void testImaginaryPartOfNumberWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Imaginary unit") public void testImaginaryUnitExhibitsDefiningProperty() { ComplexNumber expected = new ComplexNumber(-1.0, 0); ComplexNumber actual = new ComplexNumber(0, 1.0).multiply(new ComplexNumber(0, 1.0)); @@ -80,6 +88,7 @@ public void testImaginaryUnitExhibitsDefiningProperty() { @Disabled("Remove to run test") @Test + @DisplayName("Add purely real numbers") public void testAdditionWithPurelyRealNumbers() { ComplexNumber expected = new ComplexNumber(3.0, 0); ComplexNumber actual = new ComplexNumber(1.0, 0).add(new ComplexNumber(2.0, 0)); @@ -88,6 +97,7 @@ public void testAdditionWithPurelyRealNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Add purely imaginary numbers") public void testAdditionWithPurelyImaginaryNumbers() { ComplexNumber expected = new ComplexNumber(0, 3.0); ComplexNumber actual = new ComplexNumber(0, 1.0).add(new ComplexNumber(0, 2.0)); @@ -96,6 +106,7 @@ public void testAdditionWithPurelyImaginaryNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Add numbers with real and imaginary part") public void testAdditionWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(4.0, 6.0); ComplexNumber actual = new ComplexNumber(1.0, 2.0).add(new ComplexNumber(3.0, 4.0)); @@ -104,6 +115,7 @@ public void testAdditionWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Subtract purely real numbers") public void testSubtractionWithPurelyRealNumbers() { ComplexNumber expected = new ComplexNumber(-1.0, 0.0); ComplexNumber actual = new ComplexNumber(1.0, 0.0).subtract(new ComplexNumber(2.0, 0.0)); @@ -112,6 +124,7 @@ public void testSubtractionWithPurelyRealNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Subtract purely imaginary numbers") public void testSubtractionWithPurelyImaginaryNumbers() { ComplexNumber expected = new ComplexNumber(0, -1.0); ComplexNumber actual = new ComplexNumber(0, 1.0).subtract(new ComplexNumber(0, 2.0)); @@ -120,6 +133,7 @@ public void testSubtractionWithPurelyImaginaryNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Subtract numbers with real and imaginary part") public void testSubtractionWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(-2.0, -2.0); ComplexNumber actual = new ComplexNumber(1.0, 2.0).subtract(new ComplexNumber(3.0, 4.0)); @@ -128,6 +142,7 @@ public void testSubtractionWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Multiply purely real numbers") public void testMultiplicationWithPurelyRealNumbers() { ComplexNumber expected = new ComplexNumber(2.0, 0); ComplexNumber actual = new ComplexNumber(1.0, 0).multiply(new ComplexNumber(2.0, 0)); @@ -136,6 +151,7 @@ public void testMultiplicationWithPurelyRealNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Multiply purely imaginary numbers") public void testMultiplicationWithPurelyImaginaryNumbers() { ComplexNumber expected = new ComplexNumber(-2.0, 0); ComplexNumber actual = new ComplexNumber(0, 1.0).multiply(new ComplexNumber(0, 2.0)); @@ -144,6 +160,7 @@ public void testMultiplicationWithPurelyImaginaryNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Multiply numbers with real and imaginary part") public void testMultiplicationWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(-5.0, 10.0); ComplexNumber actual = new ComplexNumber(1.0, 2.0).multiply(new ComplexNumber(3.0, 4.0)); @@ -152,6 +169,7 @@ public void testMultiplicationWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Divide purely real numbers") public void testDivisionWithPurelyRealNumbers() { ComplexNumber expected = new ComplexNumber(0.5, 0); ComplexNumber actual = new ComplexNumber(1.0, 0).divide(new ComplexNumber(2.0, 0)); @@ -160,6 +178,7 @@ public void testDivisionWithPurelyRealNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Divide purely imaginary numbers") public void testDivisionWithPurelyImaginaryNumbers() { ComplexNumber expected = new ComplexNumber(0.5, 0); ComplexNumber actual = new ComplexNumber(0, 1.0).divide(new ComplexNumber(0, 2.0)); @@ -168,6 +187,7 @@ public void testDivisionWithPurelyImaginaryNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Divide numbers with real and imaginary part") public void testDivisionWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(0.44, 0.08); ComplexNumber actual = new ComplexNumber(1.0, 2.0).divide(new ComplexNumber(3.0, 4.0)); @@ -176,6 +196,7 @@ public void testDivisionWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Absolute value of a positive purely real number") public void testAbsoluteValueOfPositivePurelyRealNumber() { double expected = 5.0; double actual = new ComplexNumber(5.0, 0).abs(); @@ -184,6 +205,7 @@ public void testAbsoluteValueOfPositivePurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Absolute value of a negative purely real number") public void testAbsoluteValueOfNegativePurelyRealNumber() { double expected = 5.0; double actual = new ComplexNumber(-5.0, 0).abs(); @@ -192,6 +214,7 @@ public void testAbsoluteValueOfNegativePurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Absolute value of a purely imaginary number with positive imaginary part") public void testAbsoluteValueOfPurelyImaginaryNumberWithPositiveImaginaryPart() { double expected = 5.0; double actual = new ComplexNumber(0, 5.0).abs(); @@ -200,6 +223,7 @@ public void testAbsoluteValueOfPurelyImaginaryNumberWithPositiveImaginaryPart() @Disabled("Remove to run test") @Test + @DisplayName("Absolute value of a purely imaginary number with negative imaginary part") public void testAbsoluteValueOfPurelyImaginaryNumberWithNegativeImaginaryPart() { double expected = 5.0; double actual = new ComplexNumber(0, -5.0).abs(); @@ -208,6 +232,7 @@ public void testAbsoluteValueOfPurelyImaginaryNumberWithNegativeImaginaryPart() @Disabled("Remove to run test") @Test + @DisplayName("Absolute value of a number with real and imaginary part") public void testAbsoluteValueOfNumberWithRealAndImaginaryParts() { double expected = 5.0; double actual = new ComplexNumber(3.0, 4.0).abs(); @@ -216,6 +241,7 @@ public void testAbsoluteValueOfNumberWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Conjugate a purely real number") public void testConjugationOfPurelyRealNumber() { ComplexNumber expected = new ComplexNumber(5.0, 0); ComplexNumber actual = new ComplexNumber(5.0, 0).conjugate(); @@ -224,6 +250,7 @@ public void testConjugationOfPurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Conjugate a purely imaginary number") public void testConjugationOfPurelyImaginaryNumber() { ComplexNumber expected = new ComplexNumber(0, -5.0); ComplexNumber actual = new ComplexNumber(0, 5.0).conjugate(); @@ -232,6 +259,7 @@ public void testConjugationOfPurelyImaginaryNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Conjugate a number with real and imaginary part") public void testConjugationOfNumberWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(1.0, -1.0); ComplexNumber actual = new ComplexNumber(1.0, 1.0).conjugate(); @@ -240,6 +268,7 @@ public void testConjugationOfNumberWithRealAndImaginaryParts() { @Disabled("Remove to run test") @Test + @DisplayName("Euler's identity/formula") public void testExponentialOfPurelyImaginaryNumber() { ComplexNumber expected = new ComplexNumber(-1.0, 0); ComplexNumber actual = new ComplexNumber(0, Math.PI).exponentialOf(); @@ -248,6 +277,7 @@ public void testExponentialOfPurelyImaginaryNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Exponential of 0") public void testExponentialOfZero() { ComplexNumber expected = new ComplexNumber(1.0, 0); ComplexNumber actual = new ComplexNumber(0, 0).exponentialOf(); @@ -256,6 +286,7 @@ public void testExponentialOfZero() { @Disabled("Remove to run test") @Test + @DisplayName("Exponential of a purely real number") public void testExponentialOfPurelyRealNumber() { ComplexNumber expected = new ComplexNumber(Math.E, 0); ComplexNumber actual = new ComplexNumber(1.0, 0).exponentialOf(); @@ -264,6 +295,7 @@ public void testExponentialOfPurelyRealNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Exponential resulting in a number with real and imaginary part") public void testExponentialOfNumberWithRealAndImaginaryParts() { ComplexNumber expected = new ComplexNumber(1, 1); ComplexNumber actual = new ComplexNumber(Math.log(2.0) / 2, Math.PI / 4).exponentialOf(); diff --git a/exercises/practice/connect/src/test/java/ConnectTest.java b/exercises/practice/connect/src/test/java/ConnectTest.java index e6bfa17c8..0bc3a12a2 100644 --- a/exercises/practice/connect/src/test/java/ConnectTest.java +++ b/exercises/practice/connect/src/test/java/ConnectTest.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 ConnectTest { @Test + @DisplayName("an empty board has no winner") public void anEmptyBoardHasNoWinner() { //GIVEN @@ -27,6 +29,7 @@ public void anEmptyBoardHasNoWinner() { @Disabled("Remove to run test") @Test + @DisplayName("X can win on a 1x1 board") public void xCanWinOnA1x1Board() { //GIVEN @@ -45,6 +48,7 @@ public void xCanWinOnA1x1Board() { @Disabled("Remove to run test") @Test + @DisplayName("O can win on a 1x1 board") public void oCanWinOnA1x1Board() { //GIVEN @@ -63,6 +67,7 @@ public void oCanWinOnA1x1Board() { @Disabled("Remove to run test") @Test + @DisplayName("only edges does not make a winner") public void onlyEdgesDoesNotMakeAWinner() { //GIVEN @@ -84,6 +89,7 @@ public void onlyEdgesDoesNotMakeAWinner() { @Disabled("Remove to run test") @Test + @DisplayName("illegal diagonal does not make a winner") public void illegalDiagonalDoesNotMakeAWinner() { //GIVEN @@ -106,6 +112,7 @@ public void illegalDiagonalDoesNotMakeAWinner() { @Disabled("Remove to run test") @Test + @DisplayName("nobody wins crossing adjacent angles") public void nobodyWinsCrossingAdjacentAngles() { //GIVEN @@ -128,6 +135,7 @@ public void nobodyWinsCrossingAdjacentAngles() { @Disabled("Remove to run test") @Test + @DisplayName("X wins crossing from left to right") public void xWinsCrossingFromLeftToRight() { //GIVEN @@ -150,6 +158,7 @@ public void xWinsCrossingFromLeftToRight() { @Disabled("Remove to run test") @Test + @DisplayName("O wins crossing from top to bottom") public void oWinsCrossingFromTopToBottom() { //GIVEN @@ -172,6 +181,7 @@ public void oWinsCrossingFromTopToBottom() { @Disabled("Remove to run test") @Test + @DisplayName("X wins using a convoluted path") public void xWinsUsingConvolutedPath() { //GIVEN @@ -194,6 +204,7 @@ public void xWinsUsingConvolutedPath() { @Disabled("Remove to run test") @Test + @DisplayName("X wins using a spiral path") public void xWinsUsingASpiralPath() { //GIVEN diff --git a/exercises/practice/crypto-square/src/test/java/CryptoSquareTest.java b/exercises/practice/crypto-square/src/test/java/CryptoSquareTest.java index 59eb4fc70..b9a668a7a 100644 --- a/exercises/practice/crypto-square/src/test/java/CryptoSquareTest.java +++ b/exercises/practice/crypto-square/src/test/java/CryptoSquareTest.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 CryptoSquareTest { @Test + @DisplayName("empty plaintext results in an empty ciphertext") public void emptyPlaintextResultsInEmptyCiphertext() { CryptoSquare cryptoSquare = new CryptoSquare(""); String expectedOutput = ""; @@ -15,6 +17,7 @@ public void emptyPlaintextResultsInEmptyCiphertext() { @Disabled("Remove to run test") @Test + @DisplayName("normalization results in empty plaintext") public void normalizationResultsInEmptyCiphertext() { CryptoSquare cryptoSquare = new CryptoSquare("... --- ..."); String expectedOutput = ""; @@ -24,6 +27,7 @@ public void normalizationResultsInEmptyCiphertext() { @Disabled("Remove to run test") @Test + @DisplayName("Lowercase") public void lettersAreLowerCasedDuringEncryption() { CryptoSquare cryptoSquare = new CryptoSquare("A"); String expectedOutput = "a"; @@ -33,6 +37,7 @@ public void lettersAreLowerCasedDuringEncryption() { @Disabled("Remove to run test") @Test + @DisplayName("Remove spaces") public void spacesAreRemovedDuringEncryption() { CryptoSquare cryptoSquare = new CryptoSquare(" b "); String expectedOutput = "b"; @@ -42,6 +47,7 @@ public void spacesAreRemovedDuringEncryption() { @Disabled("Remove to run test") @Test + @DisplayName("Remove punctuation") public void punctuationIsRemovedDuringEncryption() { CryptoSquare cryptoSquare = new CryptoSquare("@1,%!"); String expectedOutput = "1"; @@ -51,6 +57,7 @@ public void punctuationIsRemovedDuringEncryption() { @Disabled("Remove to run test") @Test + @DisplayName("9 character plaintext results in 3 chunks of 3 characters") public void nineCharacterPlaintextResultsInThreeChunksOfThreeCharacters() { CryptoSquare cryptoSquare = new CryptoSquare("This is fun!"); String expectedOutput = "tsf hiu isn"; @@ -60,6 +67,7 @@ public void nineCharacterPlaintextResultsInThreeChunksOfThreeCharacters() { @Disabled("Remove to run test") @Test + @DisplayName("8 character plaintext results in 3 chunks, the last one with a trailing space") public void eightCharacterPlaintextResultsInThreeChunksWithATrailingSpace() { CryptoSquare cryptoSquare = new CryptoSquare("Chill out."); String expectedOutput = "clu hlt io "; @@ -69,6 +77,7 @@ public void eightCharacterPlaintextResultsInThreeChunksWithATrailingSpace() { @Disabled("Remove to run test") @Test + @DisplayName("54 character plaintext results in 7 chunks, the last two with trailing spaces") public void fiftyFourCharacterPlaintextResultsInSevenChunksWithTrailingSpaces() { CryptoSquare cryptoSquare = new CryptoSquare("If man was meant to stay on the ground, god would have " + "given us roots.");