diff --git a/exercises/practice/dnd-character/src/test/java/DnDCharacterTest.java b/exercises/practice/dnd-character/src/test/java/DnDCharacterTest.java index 1c9afc921..c54ad52ac 100644 --- a/exercises/practice/dnd-character/src/test/java/DnDCharacterTest.java +++ b/exercises/practice/dnd-character/src/test/java/DnDCharacterTest.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.util.List; @@ -10,150 +11,175 @@ public class DnDCharacterTest { private DnDCharacter dndCharacter = new DnDCharacter(); @Test + @DisplayName("ability modifier for score 3 is -4") public void testAbilityModifierForScore3IsNegative4() { assertThat(dndCharacter.modifier(3)).isEqualTo(-4); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 4 is -3") public void testAbilityModifierForScore4IsNegative3() { assertThat(dndCharacter.modifier(4)).isEqualTo(-3); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 5 is -3") public void testAbilityModifierForScore5IsNegative3() { assertThat(dndCharacter.modifier(5)).isEqualTo(-3); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 6 is -2") public void testAbilityModifierForScore6IsNegative2() { assertThat(dndCharacter.modifier(6)).isEqualTo(-2); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 7 is -2") public void testAbilityModifierForScore7IsNegative2() { assertThat(dndCharacter.modifier(7)).isEqualTo(-2); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 8 is -1") public void testAbilityModifierForScore8IsNegative1() { assertThat(dndCharacter.modifier(8)).isEqualTo(-1); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 9 is -1") public void testAbilityModifierForScore9IsNegative1() { assertThat(dndCharacter.modifier(9)).isEqualTo(-1); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 10 is 0") public void testAbilityModifierForScore10Is0() { assertThat(dndCharacter.modifier(10)).isEqualTo(0); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 11 is 0") public void testAbilityModifierForScore11Is0() { assertThat(dndCharacter.modifier(11)).isEqualTo(0); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 12 is +1") public void testAbilityModifierForScore12Is1() { assertThat(dndCharacter.modifier(12)).isEqualTo(1); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 13 is +1") public void testAbilityModifierForScore13Is1() { assertThat(dndCharacter.modifier(13)).isEqualTo(1); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 14 is +2") public void testAbilityModifierForScore14Is2() { assertThat(dndCharacter.modifier(14)).isEqualTo(2); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 15 is +2") public void testAbilityModifierForScore15Is2() { assertThat(dndCharacter.modifier(15)).isEqualTo(2); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 16 is +3") public void testAbilityModifierForScore16Is3() { assertThat(dndCharacter.modifier(16)).isEqualTo(3); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 17 is +3") public void testAbilityModifierForScore17Is3() { assertThat(dndCharacter.modifier(17)).isEqualTo(3); } @Disabled("Remove to run test") @Test + @DisplayName("ability modifier for score 18 is +4") public void testAbilityModifierForScore18Is4() { assertThat(dndCharacter.modifier(18)).isEqualTo(4); } @Disabled("Remove to run test") @Test + @DisplayName("Rolling uses 4 dice") public void test4DiceWereUsedForRollingScores() { assertThat(dndCharacter.rollDice().size()).isEqualTo(4); } @Disabled("Remove to run test") @Test + @DisplayName("Dice values are between 1 and 6 inclusive") public void testDiceValuesBetween1And6() { assertThat(dndCharacter.rollDice()).allMatch(d -> d >= 1 && d <= 6); } @Disabled("Remove to run test") @Test + @DisplayName("Ability uses 3 largest numbers from scores in descending order") public void testAbilityCalculationsUses3LargestNumbersFromScoresInDescendingOrder() { assertThat(dndCharacter.ability(List.of(4, 3, 2, 1))).isEqualTo(9); } @Disabled("Remove to run test") @Test + @DisplayName("Ability uses 3 largest numbers from scores in ascending order") public void testAbilityCalculationsUses3LargestNumbersFromFromScoresInAscendingOrder() { assertThat(dndCharacter.ability(List.of(1, 2, 3, 4))).isEqualTo(9); } @Disabled("Remove to run test") @Test + @DisplayName("Ability uses 3 largest numbers from scores in random order") public void testAbilityCalculationsUses3LargestNumbersFromScoresInRandomOrder() { assertThat(dndCharacter.ability(List.of(2, 4, 3, 1))).isEqualTo(9); } @Disabled("Remove to run test") @Test + @DisplayName("Ability with all lowest equal numbers yields 3") public void testAbilityCalculationsWithLowestEqualNumbers() { assertThat(dndCharacter.ability(List.of(1, 1, 1, 1))).isEqualTo(3); } @Disabled("Remove to run test") @Test + @DisplayName("Ability with all highest equal numbers yields 18") public void testAbilityCalculationsWithHighestEqualNumbers() { assertThat(dndCharacter.ability(List.of(6, 6, 6, 6))).isEqualTo(18); } @Disabled("Remove to run test") @Test + @DisplayName("Ability calculation with two lowest numbers") public void testAbilityCalculationsWithTwoLowestNumbers() { assertThat(dndCharacter.ability(List.of(3, 5, 3, 4))).isEqualTo(12); } @Disabled("Remove to run test") @Test + @DisplayName("Ability calculation does not mutate input scores") public void testAbilityCalculationDoesNotChangeInputScores() { List scores = List.of(1, 2, 3, 4); dndCharacter.ability(scores); @@ -164,6 +190,7 @@ public void testAbilityCalculationDoesNotChangeInputScores() { @Disabled("Remove to run test") @Test + @DisplayName("random character is valid") public void testRandomCharacterIsValid() { for (int i = 0; i < 1000; i++) { DnDCharacter character = new DnDCharacter(); @@ -179,6 +206,7 @@ public void testRandomCharacterIsValid() { @Disabled("Remove to run test") @Test + @DisplayName("each ability is only calculated once") public void testEachAbilityIsOnlyCalculatedOnce() { assertThat(dndCharacter.getStrength()).isEqualTo(dndCharacter.getStrength()); assertThat(dndCharacter.getDexterity()).isEqualTo(dndCharacter.getDexterity()); @@ -190,6 +218,7 @@ public void testEachAbilityIsOnlyCalculatedOnce() { @Disabled("Remove to run test") @Test + @DisplayName("Each randomly created character should be unique in attributes") public void testUniqueCharacterIsCreated() { DnDCharacter uniqueDnDCharacter = new DnDCharacter(); for (int i = 0; i < 1000; i++) { diff --git a/exercises/practice/error-handling/src/test/java/ErrorHandlingTest.java b/exercises/practice/error-handling/src/test/java/ErrorHandlingTest.java index c7864c7ad..7459b687f 100644 --- a/exercises/practice/error-handling/src/test/java/ErrorHandlingTest.java +++ b/exercises/practice/error-handling/src/test/java/ErrorHandlingTest.java @@ -1,16 +1,18 @@ -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.util.Optional; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + public class ErrorHandlingTest { private ErrorHandling errorHandling = new ErrorHandling(); @Test + @DisplayName("Throws IllegalArgumentException") public void testThrowIllegalArgumentException() { assertThatExceptionOfType(Exception.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingIllegalArgumentException()); @@ -18,6 +20,7 @@ public void testThrowIllegalArgumentException() { @Disabled("Remove to run test") @Test + @DisplayName("Throws IllegalArgumentException with provided detail message") public void testThrowIllegalArgumentExceptionWithDetailMessage() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingIllegalArgumentExceptionWithDetailMessage( @@ -27,6 +30,7 @@ public void testThrowIllegalArgumentExceptionWithDetailMessage() { @Disabled("Remove to run test") @Test + @DisplayName("Throws any checked exception") public void testThrowAnyCheckedException() { assertThatExceptionOfType(Exception.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingAnyCheckedException()) @@ -35,6 +39,7 @@ public void testThrowAnyCheckedException() { @Disabled("Remove to run test") @Test + @DisplayName("Throws any checked exception with provided detail message") public void testThrowAnyCheckedExceptionWithDetailMessage() { assertThatExceptionOfType(Exception.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingAnyCheckedExceptionWithDetailMessage( @@ -45,6 +50,7 @@ public void testThrowAnyCheckedExceptionWithDetailMessage() { @Disabled("Remove to run test") @Test + @DisplayName("Throws any unchecked exception") public void testThrowAnyUncheckedException() { assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingAnyUncheckedException()); @@ -52,6 +58,7 @@ public void testThrowAnyUncheckedException() { @Disabled("Remove to run test") @Test + @DisplayName("Throws any unchecked exception with provided detail message") public void testThrowAnyUncheckedExceptionWithDetailMessage() { assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingAnyUncheckedExceptionWithDetailMessage( @@ -61,6 +68,7 @@ public void testThrowAnyUncheckedExceptionWithDetailMessage() { @Disabled("Remove to run test") @Test + @DisplayName("Throws custom checked exception") public void testThrowCustomCheckedException() { assertThatExceptionOfType(CustomCheckedException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingCustomCheckedException()); @@ -68,6 +76,7 @@ public void testThrowCustomCheckedException() { @Disabled("Remove to run test") @Test + @DisplayName("Throws custom checked exception with provided detail message") public void testThrowCustomCheckedExceptionWithDetailMessage() { assertThatExceptionOfType(CustomCheckedException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingCustomCheckedExceptionWithDetailMessage( @@ -77,6 +86,7 @@ public void testThrowCustomCheckedExceptionWithDetailMessage() { @Disabled("Remove to run test") @Test + @DisplayName("Throws custom unchecked exception") public void testThrowCustomUncheckedException() { assertThatExceptionOfType(CustomUncheckedException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingCustomUncheckedException()); @@ -84,6 +94,7 @@ public void testThrowCustomUncheckedException() { @Disabled("Remove to run test") @Test + @DisplayName("Throws custom unchecked exception with provided detail message") public void testThrowCustomUncheckedExceptionWithDetailMessage() { assertThatExceptionOfType(CustomUncheckedException.class) .isThrownBy(() -> errorHandling.handleErrorByThrowingCustomUncheckedExceptionWithDetailMessage( @@ -93,6 +104,7 @@ public void testThrowCustomUncheckedExceptionWithDetailMessage() { @Disabled("Remove to run test") @Test + @DisplayName("Handles error by throwing Optional instance") public void testReturnOptionalInstance() { Optional successfulResult = errorHandling.handleErrorByReturningOptionalInstance("1"); assertThat(successfulResult).isPresent().hasValue(1); diff --git a/exercises/practice/hangman/src/test/java/HangmanTest.java b/exercises/practice/hangman/src/test/java/HangmanTest.java index df60dbee9..d4bbe13da 100644 --- a/exercises/practice/hangman/src/test/java/HangmanTest.java +++ b/exercises/practice/hangman/src/test/java/HangmanTest.java @@ -1,8 +1,10 @@ import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import io.reactivex.disposables.Disposable; + 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 java.util.ArrayList; @@ -22,6 +24,7 @@ public void init() { } @Test + @DisplayName("Initial game state is set correctly") public void initialization() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -39,6 +42,7 @@ public void initialization() { @Disabled("Remove to run test") @Test + @DisplayName("First correct guess updates discovered and guess lists") public void firstGuess() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -54,6 +58,7 @@ public void firstGuess() { @Disabled("Remove to run test") @Test + @DisplayName("First incorrect guess registers a miss and adds a part") public void firstMiss() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -69,6 +74,7 @@ public void firstMiss() { @Disabled("Remove to run test") @Test + @DisplayName("Game in progress accumulates guesses, misses and parts correctly") public void gameInProgress() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -84,6 +90,7 @@ public void gameInProgress() { @Disabled("Remove to run test") @Test + @DisplayName("Winning the game results in WIN status") public void wonGame() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -97,6 +104,7 @@ public void wonGame() { @Disabled("Remove to run test") @Test + @DisplayName("Losing the game results in LOSS status") public void lostGame() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -118,6 +126,7 @@ public void lostGame() { @Disabled("Remove to run test") @Test + @DisplayName("Handles consecutive games correctly with ordered emissions") public void consecutiveGames() { // This test setup is more complex because we have to order the emission of values in the // different observers. @@ -189,6 +198,7 @@ Observable createLetterObservable(ObservableEmitter[] emitters, Runnable emit) { @Disabled("Remove to run test") @Test + @DisplayName("Cannot play the same guess twice") public void cannotPlayAGuessTwice() { Observable result = hangman.play( Observable.fromArray("secret"), @@ -201,6 +211,7 @@ public void cannotPlayAGuessTwice() { @Disabled("Remove to run test") @Test + @DisplayName("Cannot play the same miss twice") public void cannotPlayAMissTwice() { Observable result = hangman.play( Observable.fromArray("secret"), diff --git a/exercises/practice/markdown/src/test/java/MarkdownTest.java b/exercises/practice/markdown/src/test/java/MarkdownTest.java index 10f0823f2..ec0f31d94 100644 --- a/exercises/practice/markdown/src/test/java/MarkdownTest.java +++ b/exercises/practice/markdown/src/test/java/MarkdownTest.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; @@ -14,6 +15,7 @@ public void setup() { } @Test + @DisplayName("parses normal text as a paragraph") public void normalTextAsAParagraph() { String input = "This will be a paragraph"; String expected = "

This will be a paragraph

"; @@ -23,6 +25,7 @@ public void normalTextAsAParagraph() { @Disabled("Remove to run test") @Test + @DisplayName("parsing italics") public void italics() { String input = "_This will be italic_"; String expected = "

This will be italic

"; @@ -32,6 +35,7 @@ public void italics() { @Disabled("Remove to run test") @Test + @DisplayName("parsing bold text") public void boldText() { String input = "__This will be bold__"; String expected = "

This will be bold

"; @@ -41,6 +45,7 @@ public void boldText() { @Disabled("Remove to run test") @Test + @DisplayName("mixed normal, italics and bold text") public void normalItalicsAndBoldText() { String input = "This will _be_ __mixed__"; String expected = "

This will be mixed

"; @@ -50,6 +55,7 @@ public void normalItalicsAndBoldText() { @Disabled("Remove to run test") @Test + @DisplayName("with h1 header level") public void withH1HeaderLevel() { String input = "# This will be an h1"; String expected = "

This will be an h1

"; @@ -59,6 +65,7 @@ public void withH1HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("with h2 header level") public void withH2HeaderLevel() { String input = "## This will be an h2"; String expected = "

This will be an h2

"; @@ -68,6 +75,7 @@ public void withH2HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("with h3 header level") public void withH3HeaderLevel() { String input = "### This will be an h3"; String expected = "

This will be an h3

"; @@ -77,6 +85,7 @@ public void withH3HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("with h4 header level") public void withH4HeaderLevel() { String input = "#### This will be an h4"; String expected = "

This will be an h4

"; @@ -86,6 +95,7 @@ public void withH4HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("with h5 header level") public void withH5HeaderLevel() { String input = "##### This will be an h5"; String expected = "
This will be an h5
"; @@ -95,6 +105,7 @@ public void withH5HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("with h6 header level") public void withH6HeaderLevel() { String input = "###### This will be an h6"; String expected = "
This will be an h6
"; @@ -104,6 +115,7 @@ public void withH6HeaderLevel() { @Disabled("Remove to run test") @Test + @DisplayName("h7 header level is a paragraph") public void h7HeaderLevelIsAParagraph() { String input = "####### This will not be an h7"; String expected = "

####### This will not be an h7

"; @@ -113,6 +125,7 @@ public void h7HeaderLevelIsAParagraph() { @Disabled("Remove to run test") @Test + @DisplayName("unordered lists") public void unorderedLists() { String input = "* Item 1\n* Item 2"; String expected = "
  • Item 1
  • Item 2
"; @@ -122,6 +135,7 @@ public void unorderedLists() { @Disabled("Remove to run test") @Test + @DisplayName("With a little bit of everything") public void aLittleBitOfEverything() { String input = "# Header!\n* __Bold Item__\n* _Italic Item_"; String expected = "

Header!

  • Bold Item
  • Italic Item
"; @@ -131,6 +145,7 @@ public void aLittleBitOfEverything() { @Disabled("Remove to run test") @Test + @DisplayName("with markdown symbols in the header text that should not be interpreted") public void markdownSymbolsInTheHeaderShouldNotBeInterpreted() { String input = "# This is a header with # and * in the text"; String expected = "

This is a header with # and * in the text

"; @@ -140,6 +155,7 @@ public void markdownSymbolsInTheHeaderShouldNotBeInterpreted() { @Disabled("Remove to run test") @Test + @DisplayName("with markdown symbols in the list item text that should not be interpreted") public void markdownSymbolsInTheListItemTextShouldNotBeInterpreted() { String input = "* Item 1 with a # in the text\n* Item 2 with * in the text"; String expected = "
  • Item 1 with a # in the text
  • Item 2 with * in the text
"; @@ -149,6 +165,7 @@ public void markdownSymbolsInTheListItemTextShouldNotBeInterpreted() { @Disabled("Remove to run test") @Test + @DisplayName("with markdown symbols in the paragraph text that should not be interpreted") public void markdownSymbolsInTheParagraphTextShouldNotBeInterpreted() { String input = "This is a paragraph with # and * in the text"; String expected = "

This is a paragraph with # and * in the text

"; @@ -158,6 +175,7 @@ public void markdownSymbolsInTheParagraphTextShouldNotBeInterpreted() { @Disabled("Remove to run test") @Test + @DisplayName("unordered lists close properly with preceding and following lines") public void markdownUnorderedListsCloseProperlyWithPrecedingAndFollowingLines() { String input = "# Start a list\n* Item 1\n* Item 2\nEnd a list"; String expected = "

Start a list

  • Item 1
  • Item 2

End a list

"; diff --git a/exercises/practice/matching-brackets/src/test/java/BracketCheckerTest.java b/exercises/practice/matching-brackets/src/test/java/BracketCheckerTest.java index f1a5b5e7e..9051b388c 100644 --- a/exercises/practice/matching-brackets/src/test/java/BracketCheckerTest.java +++ b/exercises/practice/matching-brackets/src/test/java/BracketCheckerTest.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 BracketCheckerTest { @Test + @DisplayName("paired square brackets") public void testPairedSquareBrackets() { BracketChecker bracketChecker = new BracketChecker("[]"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -13,6 +15,7 @@ public void testPairedSquareBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("empty string") public void testEmptyString() { BracketChecker bracketChecker = new BracketChecker(""); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -20,6 +23,7 @@ public void testEmptyString() { @Disabled("Remove to run test") @Test + @DisplayName("unpaired brackets") public void testUnpairedBrackets() { BracketChecker bracketChecker = new BracketChecker("[["); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -27,6 +31,7 @@ public void testUnpairedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("wrong ordered brackets") public void testWrongOrderedBrackets() { BracketChecker bracketChecker = new BracketChecker("}{"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -34,6 +39,7 @@ public void testWrongOrderedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("wrong closing bracket") public void testWrongClosingBracket() { BracketChecker bracketChecker = new BracketChecker("{]"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -41,6 +47,7 @@ public void testWrongClosingBracket() { @Disabled("Remove to run test") @Test + @DisplayName("paired with whitespace") public void testPairedWithWhitespace() { BracketChecker bracketChecker = new BracketChecker("{ }"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -48,6 +55,7 @@ public void testPairedWithWhitespace() { @Disabled("Remove to run test") @Test + @DisplayName("partially paired brackets") public void testPartiallyPairedBrackets() { BracketChecker bracketChecker = new BracketChecker("{[])"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -55,6 +63,7 @@ public void testPartiallyPairedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("simple nested brackets") public void testSimpleNestedBrackets() { BracketChecker bracketChecker = new BracketChecker("{[]}"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -62,6 +71,7 @@ public void testSimpleNestedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("several paired brackets") public void testSeveralPairedBrackets() { BracketChecker bracketChecker = new BracketChecker("{}[]"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -69,6 +79,7 @@ public void testSeveralPairedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("paired and nested brackets") public void testPairedAndNestedBrackets() { BracketChecker bracketChecker = new BracketChecker("([{}({}[])])"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -76,6 +87,7 @@ public void testPairedAndNestedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("unopened closing brackets") public void testUnopenedClosingBracket() { BracketChecker bracketChecker = new BracketChecker("{[)][]}"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -83,6 +95,7 @@ public void testUnopenedClosingBracket() { @Disabled("Remove to run test") @Test + @DisplayName("unpaired and nested brackets") public void testUnpairedAndNestedBrackets() { BracketChecker bracketChecker = new BracketChecker("([{])"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -90,6 +103,7 @@ public void testUnpairedAndNestedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("paired and wrong nested brackets") public void testPairedAndWrongNestedBrackets() { BracketChecker bracketChecker = new BracketChecker("[({]})"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -97,6 +111,7 @@ public void testPairedAndWrongNestedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("paired and wrong nested brackets but innermost are correct") public void testPairedAndWrongNestedBracketsButInnermostAreCorrect() { BracketChecker bracketChecker = new BracketChecker("[({}])"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -104,6 +119,7 @@ public void testPairedAndWrongNestedBracketsButInnermostAreCorrect() { @Disabled("Remove to run test") @Test + @DisplayName("paired and incomplete brackets") public void testPairedAndIncompleteBrackets() { BracketChecker bracketChecker = new BracketChecker("{}["); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -111,6 +127,7 @@ public void testPairedAndIncompleteBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("too many closing brackets") public void testTooManyClosingBrackets() { BracketChecker bracketChecker = new BracketChecker("[]]"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -118,13 +135,15 @@ public void testTooManyClosingBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("early unexpected brackets") public void testEarlyUnexpectedBrackets() { BracketChecker bracketChecker = new BracketChecker(")()"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); } - + @Disabled("Remove to run test") @Test + @DisplayName("early mismatched brackets") public void testEarlyMismatchedBrackets() { BracketChecker bracketChecker = new BracketChecker("{)()"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isFalse(); @@ -132,6 +151,7 @@ public void testEarlyMismatchedBrackets() { @Disabled("Remove to run test") @Test + @DisplayName("math expression") public void testMathExpression() { BracketChecker bracketChecker = new BracketChecker("(((185 + 223.85) * 15) - 543)/2"); assertThat(bracketChecker.areBracketsMatchedAndNestedCorrectly()).isTrue(); @@ -139,6 +159,7 @@ public void testMathExpression() { @Disabled("Remove to run test") @Test + @DisplayName("complex latex expression") public void testComplexLatexExpression() { BracketChecker bracketChecker = new BracketChecker( "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"); diff --git a/exercises/practice/mazy-mice/src/test/java/MazeGeneratorTest.java b/exercises/practice/mazy-mice/src/test/java/MazeGeneratorTest.java index 24e5de663..8b3635f2a 100644 --- a/exercises/practice/mazy-mice/src/test/java/MazeGeneratorTest.java +++ b/exercises/practice/mazy-mice/src/test/java/MazeGeneratorTest.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 java.util.Set; @@ -37,6 +38,7 @@ public void setup() { } @Test + @DisplayName("Maze has correct overall dimensions") public void theDimensionsOfTheMazeAreCorrect() { var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); var expectedWidth = RECTANGLE_COLUMNS * 2 + 1; @@ -49,6 +51,7 @@ public void theDimensionsOfTheMazeAreCorrect() { @Disabled("Remove to run test") @Test + @DisplayName("Maze contains only valid characters") public void theMazeContainsOnlyValidCharacters() { var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); @@ -63,7 +66,8 @@ public void theMazeContainsOnlyValidCharacters() { @Disabled("Remove to run test") @Test - public void theMazeHasOnlyOneEntranceOnTheLeftSide() { + @DisplayName("Maze has a single entrance on the left side") + public void theMazeHasSingleEntranceOnTheLeftSide() { var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); int entranceCount = countEntrances(maze); @@ -74,7 +78,8 @@ public void theMazeHasOnlyOneEntranceOnTheLeftSide() { @Disabled("Remove to run test") @Test - public void theMazeHasSingleExitOnTheRightSideOfTheMaze() { + @DisplayName("Maze has a single exit on the right side") + public void theMazeHasSingleExitOnTheRightSide() { var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); int exitCount = countExits(maze); @@ -85,6 +90,7 @@ public void theMazeHasSingleExitOnTheRightSideOfTheMaze() { @Disabled("Remove to run test") @Test + @DisplayName("Maze is different each time it is generated") public void aMazeIsDifferentEachTimeItIsGenerated() { var maze1 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); var maze2 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); @@ -96,6 +102,27 @@ public void aMazeIsDifferentEachTimeItIsGenerated() { @Disabled("Remove to run test") @Test + @DisplayName("Maze is generated perfectly (single path, no isolated cells)") + public void theMazeIsPerfect() { + var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); + + assertThatMazeHasSinglePath(maze); + assertThatMazeHasNoIsolatedSections(maze); + } + + @Disabled("Remove to run test") + @Test + @DisplayName("Maze with a seed is generated perfectly (single path, no isolated cells)") + public void theMazeIsPerfectWithSeed() { + var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_ONE); + + assertThatMazeHasSinglePath(maze); + assertThatMazeHasNoIsolatedSections(maze); + } + + @Disabled("Remove to run test") + @Test + @DisplayName("Mazes generated with same seed are identical") public void twoMazesWithSameSeedShouldBeEqual() { var maze1 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_ONE); var maze2 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_ONE); @@ -107,6 +134,7 @@ public void twoMazesWithSameSeedShouldBeEqual() { @Disabled("Remove to run test") @Test + @DisplayName("Mazes generated with different seeds are different") public void twoMazesWithDifferentSeedsShouldNotBeEqual() { var maze1 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_ONE); var maze2 = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_TWO); @@ -118,24 +146,7 @@ public void twoMazesWithDifferentSeedsShouldNotBeEqual() { @Disabled("Remove to run test") @Test - public void theMazeIsPerfect() { - var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS); - - assertThatMazeHasSinglePath(maze); - assertThatMazeHasNoIsolatedSections(maze); - } - - @Disabled("Remove to run test") - @Test - public void theMazeIsPerfectWithSeed() { - var maze = sut.generatePerfectMaze(RECTANGLE_ROWS, RECTANGLE_COLUMNS, SEED_ONE); - - assertThatMazeHasSinglePath(maze); - assertThatMazeHasNoIsolatedSections(maze); - } - - @Disabled("Remove to run test") - @Test + @DisplayName("Throws when rows are less than five") public void shouldThrowExceptionWhenRowsIsLessThanFive() { assertThatIllegalArgumentException() .isThrownBy(() -> sut.generatePerfectMaze(0, RECTANGLE_COLUMNS)); @@ -143,6 +154,7 @@ public void shouldThrowExceptionWhenRowsIsLessThanFive() { @Disabled("Remove to run test") @Test + @DisplayName("Throws when columns are less than five") public void shouldThrowExceptionWhenColumnsIsLessThanFive() { assertThatIllegalArgumentException() .isThrownBy(() -> sut.generatePerfectMaze(RECTANGLE_ROWS, 0)); @@ -150,6 +162,7 @@ public void shouldThrowExceptionWhenColumnsIsLessThanFive() { @Disabled("Remove to run test") @Test + @DisplayName("Throws when rows exceed hundred") public void shouldThrowExceptionWhenRowsIsMoreThenHundred() { assertThatIllegalArgumentException() .isThrownBy(() -> sut.generatePerfectMaze(101, RECTANGLE_COLUMNS)); @@ -157,6 +170,7 @@ public void shouldThrowExceptionWhenRowsIsMoreThenHundred() { @Disabled("Remove to run test") @Test + @DisplayName("Throws when columns exceed hundred") public void shouldThrowExceptionWhenColumnsIsMoreThenHundred() { assertThatIllegalArgumentException() .isThrownBy(() -> sut.generatePerfectMaze(RECTANGLE_ROWS, 101)); diff --git a/exercises/practice/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.java b/exercises/practice/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.java index 1f3e83ba3..cce168b52 100644 --- a/exercises/practice/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.java +++ b/exercises/practice/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.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.util.Arrays; @@ -205,6 +206,7 @@ public class ParallelLetterFrequencyTest { "- from the days of the Flood to the Schleswig-Holstein period."; @Test + @DisplayName("no texts") public void testNoTexts() { String[] input = {}; Map expectedOutput = new HashMap<>(); @@ -215,6 +217,7 @@ public void testNoTexts() { @Disabled("Remove to run test") @Test + @DisplayName("one text with one letter") public void testOneTextWithOneLetter() { String[] input = { "a" }; Map expectedOutput = new HashMap<>() { @@ -229,6 +232,7 @@ public void testOneTextWithOneLetter() { @Disabled("Remove to run test") @Test + @DisplayName("one text with multiple letters") public void testOneTextWithMultipleLetters() { String[] input = { "bbcccd" }; Map expectedOutput = new HashMap<>() { @@ -245,6 +249,7 @@ public void testOneTextWithMultipleLetters() { @Disabled("Remove to run test") @Test + @DisplayName("two texts with one letter") public void testTwoTextsWithOneLetter() { String[] input = { "e", "f" }; Map expectedOutput = new HashMap<>() { @@ -260,6 +265,7 @@ public void testTwoTextsWithOneLetter() { @Disabled("Remove to run test") @Test + @DisplayName("two texts with multiple letters") public void testTwoTextsWithMultipleLetters() { String[] input = { "ggh", "hhi" }; Map expectedOutput = new HashMap<>() { @@ -276,6 +282,7 @@ public void testTwoTextsWithMultipleLetters() { @Disabled("Remove to run test") @Test + @DisplayName("ignore letter casing") public void testIgnoreLetterCasing() { String[] input = { "m", "M" }; Map expectedOutput = new HashMap<>() { @@ -290,6 +297,7 @@ public void testIgnoreLetterCasing() { @Disabled("Remove to run test") @Test + @DisplayName("ignore whitespace") public void testIgnoreWhitespace() { String[] input = { " ", "\t", "\r\n" }; Map expectedOutput = new HashMap<>(); @@ -300,6 +308,7 @@ public void testIgnoreWhitespace() { @Disabled("Remove to run test") @Test + @DisplayName("ignore punctuation") public void testIgnorePunctuation() { String[] input = { "!", "?", ";", ",", "." }; Map expectedOutput = new HashMap<>(); @@ -310,6 +319,7 @@ public void testIgnorePunctuation() { @Disabled("Remove to run test") @Test + @DisplayName("ignore numbers") public void testIgnoreNumbers() { String[] input = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; Map expectedOutput = new HashMap<>(); @@ -320,6 +330,7 @@ public void testIgnoreNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Unicode letters") public void testUnicodeLetters() { String[] input = { "本", "φ", "ほ", "ø" }; Map expectedOutput = new HashMap<>() { @@ -337,6 +348,7 @@ public void testUnicodeLetters() { @Disabled("Remove to run test") @Test + @DisplayName("combination of lower- and uppercase letters, punctuation and white space") public void testCombinationOfLowerAndUppercaseLettersPunctuationAndWhiteSpace() { String[] input = {calculateFrequencies}; Map expectedOutput = new HashMap<>() { @@ -369,26 +381,10 @@ public void testCombinationOfLowerAndUppercaseLettersPunctuationAndWhiteSpace() assertThat(p.countLetters()).isEqualTo(expectedOutput); } - - @Disabled("Remove to run test") - @Test - public void testManySmallTexts() { - String[] input = new String[50]; - Arrays.fill(input, "abbccc"); - Map expectedOutput = new HashMap<>() { - { - put('a', 50); - put('b', 100); - put('c', 150); - } - }; - ParallelLetterFrequency p = new ParallelLetterFrequency(input); - - assertThat(p.countLetters()).isEqualTo(expectedOutput); - } @Disabled("Remove to run test") @Test + @DisplayName("large texts") public void testLargeTexts() { String[] input = { largeTexts1, largeTexts2, largeTexts3, largeTexts4 }; Map expectedOutput = new HashMap<>() { @@ -423,6 +419,24 @@ public void testLargeTexts() { ParallelLetterFrequency p = new ParallelLetterFrequency(input); assertThat(p.countLetters()).isEqualTo(expectedOutput); - } + } + + @Disabled("Remove to run test") + @Test + @DisplayName("many small texts") + public void testManySmallTexts() { + String[] input = new String[50]; + Arrays.fill(input, "abbccc"); + Map expectedOutput = new HashMap<>() { + { + put('a', 50); + put('b', 100); + put('c', 150); + } + }; + ParallelLetterFrequency p = new ParallelLetterFrequency(input); + + assertThat(p.countLetters()).isEqualTo(expectedOutput); + } } diff --git a/exercises/practice/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java b/exercises/practice/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java index c72c2dc07..becdb0825 100644 --- a/exercises/practice/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java +++ b/exercises/practice/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.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; @@ -9,6 +10,7 @@ public class PascalsTriangleGeneratorTest { new PascalsTriangleGenerator(); @Test + @DisplayName("zero rows") public void testTriangleWithZeroRows() { int[][] expectedOutput = new int[][]{}; @@ -17,6 +19,7 @@ public void testTriangleWithZeroRows() { @Disabled("Remove to run test") @Test + @DisplayName("single row") public void testTriangleWithOneRow() { int[][] expectedOutput = new int[][]{ {1} @@ -27,6 +30,7 @@ public void testTriangleWithOneRow() { @Disabled("Remove to run test") @Test + @DisplayName("two rows") public void testTriangleWithTwoRows() { int[][] expectedOutput = new int[][]{ {1}, @@ -38,6 +42,7 @@ public void testTriangleWithTwoRows() { @Disabled("Remove to run test") @Test + @DisplayName("three rows") public void testTriangleWithThreeRows() { int[][] expectedOutput = new int[][]{ {1}, @@ -50,6 +55,7 @@ public void testTriangleWithThreeRows() { @Disabled("Remove to run test") @Test + @DisplayName("four rows") public void testTriangleWithFourRows() { int[][] expectedOutput = new int[][]{ {1}, @@ -63,6 +69,7 @@ public void testTriangleWithFourRows() { @Disabled("Remove to run test") @Test + @DisplayName("five rows") public void testTriangleWithFiveRows() { int[][] expectedOutput = new int[][]{ {1}, @@ -77,6 +84,7 @@ public void testTriangleWithFiveRows() { @Disabled("Remove to run test") @Test + @DisplayName("six rows") public void testTriangleWithSixRows() { int[][] expectedOutput = new int[][]{ {1}, @@ -92,6 +100,7 @@ public void testTriangleWithSixRows() { @Disabled("Remove to run test") @Test + @DisplayName("ten rows") public void testTriangleWithTenRows() { int[][] expectedOutput = new int[][]{ {1}, diff --git a/exercises/practice/perfect-numbers/src/test/java/NaturalNumberTest.java b/exercises/practice/perfect-numbers/src/test/java/NaturalNumberTest.java index b7387c4b1..58af24598 100644 --- a/exercises/practice/perfect-numbers/src/test/java/NaturalNumberTest.java +++ b/exercises/practice/perfect-numbers/src/test/java/NaturalNumberTest.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; @@ -7,66 +8,77 @@ public class NaturalNumberTest { @Test + @DisplayName("Smallest perfect number is classified correctly") public void testSmallPerfectNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(6).getClassification()).isEqualTo(Classification.PERFECT); } @Disabled("Remove to run test") @Test + @DisplayName("Medium perfect number is classified correctly") public void testMediumPerfectNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(28).getClassification()).isEqualTo(Classification.PERFECT); } @Disabled("Remove to run test") @Test + @DisplayName("Large perfect number is classified correctly") public void testLargePerfectNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(33550336).getClassification()).isEqualTo(Classification.PERFECT); } @Disabled("Remove to run test") @Test + @DisplayName("Smallest abundant number is classified correctly") public void testSmallAbundantNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(12).getClassification()).isEqualTo(Classification.ABUNDANT); } @Disabled("Remove to run test") @Test + @DisplayName("Medium abundant number is classified correctly") public void testMediumAbundantNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(30).getClassification()).isEqualTo(Classification.ABUNDANT); } @Disabled("Remove to run test") @Test + @DisplayName("Large abundant number is classified correctly") public void testLargeAbundantNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(33550335).getClassification()).isEqualTo(Classification.ABUNDANT); } @Disabled("Remove to run test") @Test + @DisplayName("Smallest prime deficient number is classified correctly") public void testSmallestPrimeDeficientNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(2).getClassification()).isEqualTo(Classification.DEFICIENT); } @Disabled("Remove to run test") @Test + @DisplayName("Smallest non-prime deficient number is classified correctly") public void testSmallestNonPrimeDeficientNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(4).getClassification()).isEqualTo(Classification.DEFICIENT); } @Disabled("Remove to run test") @Test + @DisplayName("Medium deficient number is classified as DEFICIENT") public void testMediumDeficientNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(32).getClassification()).isEqualTo(Classification.DEFICIENT); } @Disabled("Remove to run test") @Test + @DisplayName("Large deficient number is classified as DEFICIENT") public void testLargeDeficientNumberIsClassifiedCorrectly() { assertThat(new NaturalNumber(33550337).getClassification()).isEqualTo(Classification.DEFICIENT); } @Disabled("Remove to run test") @Test + @DisplayName("Edge case (no factors other than itself) is classified correctly") /* * The number 1 has no proper divisors (https://en.wikipedia.org/wiki/Divisor#Further_notions_and_facts), and the * additive identity is 0, so the aliquot sum of 1 should be 0. Hence 1 should be classified as deficient. @@ -77,6 +89,7 @@ public void testThatOneIsCorrectlyClassifiedAsDeficient() { @Disabled("Remove to run test") @Test + @DisplayName("Zero is rejected (as it is not a positive integer)") public void testThatNonNegativeIntegerIsRejected() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new NaturalNumber(0)) @@ -85,6 +98,7 @@ public void testThatNonNegativeIntegerIsRejected() { @Disabled("Remove to run test") @Test + @DisplayName("Negative integer is rejected (as it is not a positive integer)") public void testThatNegativeIntegerIsRejected() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new NaturalNumber(-1)) diff --git a/exercises/practice/phone-number/src/test/java/PhoneNumberTest.java b/exercises/practice/phone-number/src/test/java/PhoneNumberTest.java index bfd7c6212..300415b65 100644 --- a/exercises/practice/phone-number/src/test/java/PhoneNumberTest.java +++ b/exercises/practice/phone-number/src/test/java/PhoneNumberTest.java @@ -1,12 +1,14 @@ -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - 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; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + public class PhoneNumberTest { @Test + @DisplayName("cleans the number") public void cleansTheNumber() { String expectedNumber = "2234567890"; String actualNumber = new PhoneNumber("(223) 456-7890").getNumber(); @@ -16,6 +18,7 @@ public void cleansTheNumber() { @Disabled("Remove to run test") @Test + @DisplayName("cleans numbers with dots") public void cleansNumbersWithDots() { String expectedNumber = "2234567890"; String actualNumber = new PhoneNumber("223.456.7890").getNumber(); @@ -26,6 +29,7 @@ public void cleansNumbersWithDots() { @Disabled("Remove to run test") @Test + @DisplayName("cleans numbers with multiple spaces") public void cleansNumbersWithMultipleSpaces() { String expectedNumber = "2234567890"; String actualNumber = new PhoneNumber("223 456 7890 ").getNumber(); @@ -35,6 +39,7 @@ public void cleansNumbersWithMultipleSpaces() { @Disabled("Remove to run test") @Test + @DisplayName("invalid when 9 digits") public void invalidWhen9Digits() { assertThatExceptionOfType(IllegalArgumentException.class) @@ -44,6 +49,7 @@ public void invalidWhen9Digits() { @Disabled("Remove to run test") @Test + @DisplayName("invalid when 11 digits does not start with a 1") public void invalidWhen11DigitsDoesNotStartWith1() { assertThatExceptionOfType(IllegalArgumentException.class) @@ -53,6 +59,7 @@ public void invalidWhen11DigitsDoesNotStartWith1() { @Disabled("Remove to run test") @Test + @DisplayName("valid when 11 digits and starting with 1") public void validWhen11DigitsAndStartingWith1() { String expectedNumber = "2234567890"; String actualNumber = new PhoneNumber("12234567890").getNumber(); @@ -62,6 +69,7 @@ public void validWhen11DigitsAndStartingWith1() { @Disabled("Remove to run test") @Test + @DisplayName("valid when 11 digits and starting with 1 even with punctuation") public void validWhen11DigitsAndStartingWith1EvenWithPunctuation() { String expectedNumber = "2234567890"; String actualNumber = new PhoneNumber("+1 (223) 456-7890").getNumber(); @@ -71,6 +79,7 @@ public void validWhen11DigitsAndStartingWith1EvenWithPunctuation() { @Disabled("Remove to run test") @Test + @DisplayName("invalid when more than 11 digits") public void invalidWhenMoreThan11Digits() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("321234567890")) @@ -79,6 +88,7 @@ public void invalidWhenMoreThan11Digits() { @Disabled("Remove to run test") @Test + @DisplayName("invalid with letters") public void invalidWithLetters() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("523-abc-7890")) @@ -87,6 +97,7 @@ public void invalidWithLetters() { @Disabled("Remove to run test") @Test + @DisplayName("invalid with punctuations") public void invalidWithPunctuations() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("523-@:!-7890")) @@ -95,6 +106,7 @@ public void invalidWithPunctuations() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if area code starts with 0") public void invalidIfAreaCodeStartsWith0() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("(023) 456-7890")) @@ -103,6 +115,7 @@ public void invalidIfAreaCodeStartsWith0() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if area code starts with 1") public void invalidIfAreaCodeStartsWith1() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("(123) 456-7890")) @@ -111,6 +124,7 @@ public void invalidIfAreaCodeStartsWith1() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if exchange code starts with 0") public void invalidIfExchangeCodeStartsWith0() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("(223) 056-7890")) @@ -119,6 +133,7 @@ public void invalidIfExchangeCodeStartsWith0() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if exchange code starts with 1") public void invalidIfExchangeCodeStartsWith1() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("(223) 156-7890")) @@ -127,6 +142,7 @@ public void invalidIfExchangeCodeStartsWith1() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if area code starts with 0 on valid 11-digit number") public void invalidIfAreaCodeStartsWith0OnValid11DigitNumber() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("1 (023) 456-7890")) @@ -135,6 +151,7 @@ public void invalidIfAreaCodeStartsWith0OnValid11DigitNumber() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if area code starts with 1 on valid 11-digit number") public void invalidIfAreaCodeStartsWith1OnValid11DigitNumber() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("1 (123) 456-7890")) @@ -143,6 +160,7 @@ public void invalidIfAreaCodeStartsWith1OnValid11DigitNumber() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if exchange code starts with 0 on valid 11-digit number") public void invalidIfExchangeCodeStartsWith0OnValid11DigitNumber() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("1 (223) 056-7890")) @@ -151,6 +169,7 @@ public void invalidIfExchangeCodeStartsWith0OnValid11DigitNumber() { @Disabled("Remove to run test") @Test + @DisplayName("invalid if exchange code starts with 1 on valid 11-digit number") public void invalidIfExchangeCodeStartsWith1OnValid11DigitNumber() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> new PhoneNumber("1 (223) 156-7890")) diff --git a/exercises/practice/piecing-it-together/src/test/java/PiecingItTogetherTest.java b/exercises/practice/piecing-it-together/src/test/java/PiecingItTogetherTest.java index b07648c0a..791302fa3 100644 --- a/exercises/practice/piecing-it-together/src/test/java/PiecingItTogetherTest.java +++ b/exercises/practice/piecing-it-together/src/test/java/PiecingItTogetherTest.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 PiecingItTogetherTest { private static final double DOUBLE_EQUALITY_TOLERANCE = 1e-9; @Test + @DisplayName("1000 pieces puzzle with 1.6 aspect ratio") public void test1000PiecesWithAspectRatio() { JigsawInfo input = new JigsawInfo.Builder() .pieces(1000) @@ -30,6 +32,7 @@ public void test1000PiecesWithAspectRatio() { @Disabled("Remove to run test") @Test + @DisplayName("square puzzle with 32 rows") public void testSquarePuzzleWith32Rows() { JigsawInfo input = new JigsawInfo.Builder() .rows(32) @@ -52,6 +55,7 @@ public void testSquarePuzzleWith32Rows() { @Disabled("Remove to run test") @Test + @DisplayName("400 pieces square puzzle with only inside pieces and aspect ratio") public void testInsideAndAspectRatioOnly() { JigsawInfo input = new JigsawInfo.Builder() .inside(324) @@ -74,6 +78,7 @@ public void testInsideAndAspectRatioOnly() { @Disabled("Remove to run test") @Test + @DisplayName("1500 pieces landscape puzzle with 30 rows and 1.6 aspect ratio") public void testLandscape1500WithRowsAndAspect() { JigsawInfo input = new JigsawInfo.Builder() .rows(30) @@ -96,6 +101,7 @@ public void testLandscape1500WithRowsAndAspect() { @Disabled("Remove to run test") @Test + @DisplayName("300 pieces portrait puzzle with 70 border pieces") public void test300PiecesPortraitWithBorder() { JigsawInfo input = new JigsawInfo.Builder() .pieces(300) @@ -119,6 +125,7 @@ public void test300PiecesPortraitWithBorder() { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with insufficient data") public void testInsufficientData() { JigsawInfo input = new JigsawInfo.Builder() .pieces(1500) @@ -132,6 +139,7 @@ public void testInsufficientData() { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with contradictory data") public void testContradictoryData() { JigsawInfo input = new JigsawInfo.Builder() .rows(100) diff --git a/exercises/practice/poker/src/test/java/PokerTest.java b/exercises/practice/poker/src/test/java/PokerTest.java index 016889229..367b776df 100644 --- a/exercises/practice/poker/src/test/java/PokerTest.java +++ b/exercises/practice/poker/src/test/java/PokerTest.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.util.Arrays; @@ -8,6 +9,7 @@ public class PokerTest { @Test + @DisplayName("single hand always wins") public void oneHand() { String hand = "4S 5S 7H 8D JC"; assertThat(new Poker(Collections.singletonList(hand)).getBestHands()) @@ -16,6 +18,7 @@ public void oneHand() { @Disabled("Remove to run test") @Test + @DisplayName("highest card out of all hands wins") public void highestCardWins() { String highest8 = "4D 5S 6S 8D 3C"; String highest10 = "2S 4C 7S 9H 10H"; @@ -26,6 +29,7 @@ public void highestCardWins() { @Disabled("Remove to run test") @Test + @DisplayName("a tie has multiple winners") public void tieHasMultipleWinners() { String highest8 = "4D 5S 6S 8D 3C"; String highest10 = "2S 4C 7S 9H 10H"; @@ -37,6 +41,7 @@ public void tieHasMultipleWinners() { @Disabled("Remove to run test") @Test + @DisplayName("multiple hands with the same high cards, tie compares next highest ranked, down to last card") public void sameHighCards() { String nextHighest3 = "3S 5H 6S 8D 7H"; String nextHighest2 = "2S 5D 6D 8C 7S"; @@ -46,6 +51,7 @@ public void sameHighCards() { @Disabled("Remove to run test") @Test + @DisplayName("winning high card hand also has the lowest card") public void winningWithLowestCard() { String lowest2 = "2S 5H 6S 8D 7H"; String lowest3 = "3S 4D 6D 8C 7S"; @@ -55,6 +61,7 @@ public void winningWithLowestCard() { @Disabled("Remove to run test") @Test + @DisplayName("one pair beats high card") public void nothingVsOnePair() { String nothing = "4S 5H 6C 8D KH"; String pairOf4 = "2S 4H 6S 4D JH"; @@ -64,6 +71,7 @@ public void nothingVsOnePair() { @Disabled("Remove to run test") @Test + @DisplayName("highest pair wins") public void twoPairs() { String pairOf2 = "4S 2H 6S 2D JH"; String pairOf4 = "2S 4H 6C 4D JD"; @@ -73,6 +81,7 @@ public void twoPairs() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have the same pair, high card wins") public void samePair() { String pairOf4Lower = "4H 4S AH JC 3D"; String pairOf4Higher = "4C 4D AS 5D 6C"; @@ -82,6 +91,7 @@ public void samePair() { @Disabled("Remove to run test") @Test + @DisplayName("two pairs beats one pair") public void onePairVsDoublePair() { String pairOf8 = "2S 8H 6S 8D JH"; String doublePair = "4S 5H 4C 8C 5C"; @@ -91,6 +101,7 @@ public void onePairVsDoublePair() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have two pairs, highest ranked pair wins") public void twoDoublePairs() { String doublePair2And8 = "2S 8H 2D 8D 3H"; String doublePair4And5 = "4S 5H 4C 8S 5D"; @@ -100,6 +111,7 @@ public void twoDoublePairs() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have two pairs, with the same highest ranked pair, tie goes to low pair") public void sameHighestPair() { String doublePair2AndQ = "2S QS 2C QD JH"; String doublePairJAndQ = "JD QH JS 8D QC"; @@ -109,6 +121,7 @@ public void sameHighestPair() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have two identically ranked pairs, tie goes to remaining card (kicker)") public void identicallyRankedPairs() { String kicker8 = "JD QH JS 8D QC"; String kicker2 = "JS QS JC 2D QD"; @@ -118,6 +131,7 @@ public void identicallyRankedPairs() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have two pairs that add to the same value, win goes to highest pair") public void twoPairsAddingToSameValue() { String doublePair6And3 = "6S 6H 3S 3H AS"; String doublePair7And2 = "7H 7S 2H 2S AC"; @@ -127,6 +141,7 @@ public void twoPairsAddingToSameValue() { @Disabled("Remove to run test") @Test + @DisplayName("two pairs first ranked by largest pair") public void rankedByLargestPair() { String doublePairs5And4 = "5C 2S 5S 4H 4C"; String doublePairs6And2 = "6S 2S 6H 7C 2C"; @@ -136,6 +151,7 @@ public void rankedByLargestPair() { @Disabled("Remove to run test") @Test + @DisplayName("three of a kind beats two pair") public void doublePairVsThree() { String doublePair2And8 = "2S 8H 2H 8D JH"; String threeOf4 = "4S 5H 4C 8S 4H"; @@ -145,6 +161,7 @@ public void doublePairVsThree() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have three of a kind, tie goes to highest ranked triplet") public void twoThrees() { String threeOf2 = "2S 2H 2C 8D JH"; String threeOf1 = "4S AH AS 8C AD"; @@ -154,6 +171,7 @@ public void twoThrees() { @Disabled("Remove to run test") @Test + @DisplayName("with multiple decks, two players can have same three of a kind, ties go to highest remaining cards") public void sameThreesMultipleDecks() { String remainingCard7 = "5S AH AS 7C AD"; String remainingCard8 = "4S AH AS 8C AD"; @@ -163,6 +181,7 @@ public void sameThreesMultipleDecks() { @Disabled("Remove to run test") @Test + @DisplayName("a straight beats three of a kind") public void threeVsStraight() { String threeOf4 = "4S 5H 4C 8D 4H"; String straight = "3S 4D 2S 6D 5C"; @@ -172,6 +191,7 @@ public void threeVsStraight() { @Disabled("Remove to run test") @Test + @DisplayName("aces can end a straight (10 J Q K A)") public void acesCanEndAStraight() { String hand = "4S 5H 4C 8D 4H"; String straightEndsA = "10D JH QS KD AC"; @@ -181,6 +201,7 @@ public void acesCanEndAStraight() { @Disabled("Remove to run test") @Test + @DisplayName("aces can start a straight (A 2 3 4 5)") public void acesCanStartAStraight() { String hand = "4S 5H 4C 8D 4H"; String straightStartA = "4D AH 3S 2D 5C"; @@ -190,6 +211,7 @@ public void acesCanStartAStraight() { @Disabled("Remove to run test") @Test + @DisplayName("aces cannot be in the middle of a straight (Q K A 2 3)") public void acesCannotBeInMiddleOfStraight() { String hand = "2C 3D 7H 5H 2S"; String straightMiddleA = "QS KH AC 2D 3S"; @@ -199,6 +221,7 @@ public void acesCannotBeInMiddleOfStraight() { @Disabled("Remove to run test") @Test + @DisplayName("both hands with a straight, tie goes to highest ranked card") public void twoStraights() { String straightTo8 = "4S 6C 7S 8D 5H"; String straightTo9 = "5S 7H 8S 9D 6H"; @@ -208,6 +231,7 @@ public void twoStraights() { @Disabled("Remove to run test") @Test + @DisplayName("even though an ace is usually high, a 5-high straight is the lowest-scoring straight") public void theLowestStraightStartsWithAce() { String straight = "2H 3C 4D 5D 6H"; String straightStartA = "4S AH 3S 2D 5H"; @@ -217,6 +241,7 @@ public void theLowestStraightStartsWithAce() { @Disabled("Remove to run test") @Test + @DisplayName("flush beats a straight") public void straightVsFlush() { String straightTo8 = "4C 6H 7D 8D 5H"; String flushTo7 = "2S 4S 5S 6S 7S"; @@ -226,6 +251,7 @@ public void straightVsFlush() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have a flush, tie goes to high card, down to the last one if necessary") public void twoFlushs() { String flushTo9 = "2H 7H 8H 9H 6H"; String flushTo7 = "3S 5S 6S 7S 8S"; @@ -235,6 +261,7 @@ public void twoFlushs() { @Disabled("Remove to run test") @Test + @DisplayName("full house beats a flush") public void flushVsFull() { String flushTo8 = "3H 6H 7H 8H 5H"; String full = "4S 5H 4C 5D 4H"; @@ -244,6 +271,7 @@ public void flushVsFull() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have a full house, tie goes to highest-ranked triplet") public void twoFulls() { String fullOf4By9 = "4H 4S 4D 9S 9D"; String fullOf5By8 = "5H 5S 5D 8S 8D"; @@ -253,6 +281,7 @@ public void twoFulls() { @Disabled("Remove to run test") @Test + @DisplayName("with multiple decks, both hands have a full house with the same triplet, tie goes to the pair") public void twoFullssameThripletMultipleDecks() { String fullOf5By9 = "5H 5S 5D 9S 9D"; String fullOf5By8 = "5H 5S 5D 8S 8D"; @@ -262,6 +291,7 @@ public void twoFullssameThripletMultipleDecks() { @Disabled("Remove to run test") @Test + @DisplayName("four of a kind beats a full house") public void fullVsSquare() { String full = "4S 5H 4D 5D 4H"; String squareOf3 = "3S 3H 2S 3D 3C"; @@ -271,6 +301,7 @@ public void fullVsSquare() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have four of a kind, tie goes to high quad") public void twoSquares() { String squareOf2 = "2S 2H 2C 8D 2D"; String squareOf5 = "4S 5H 5S 5D 5C"; @@ -280,6 +311,7 @@ public void twoSquares() { @Disabled("Remove to run test") @Test + @DisplayName("with multiple decks, both hands with identical four of a kind, tie determined by kicker") public void sameSquaresMultipleDecks() { String kicker2 = "3S 3H 2S 3D 3C"; String kicker4 = "3S 3H 4S 3D 3C"; @@ -289,6 +321,7 @@ public void sameSquaresMultipleDecks() { @Disabled("Remove to run test") @Test + @DisplayName("straight flush beats four of a kind") public void squareVsStraightFlush() { String squareOf5 = "4S 5H 5S 5D 5C"; String straightFlushTo9 = "7S 8S 9S 6S 10S"; @@ -298,6 +331,7 @@ public void squareVsStraightFlush() { @Disabled("Remove to run test") @Test + @DisplayName("aces can end a straight flush (10 J Q K A)") public void acesEndingStraightFlush() { String hand = "KC AH AS AD AC"; String straightFlushEndingWithA = "10C JC QC KC AC"; @@ -307,6 +341,7 @@ public void acesEndingStraightFlush() { @Disabled("Remove to run test") @Test + @DisplayName("aces can start a straight flush (A 2 3 4 5)") public void acesStartingStraightFlush() { String straightFlushStartingWithA = "4H AH 3H 2H 5H"; String hand = "KS AH AS AD AC"; @@ -316,6 +351,7 @@ public void acesStartingStraightFlush() { @Disabled("Remove to run test") @Test + @DisplayName("aces cannot be in the middle of a straight flush (Q K A 2 3)") public void acesCannotBeInMiddleOfStraightFlush() { String straightFlushWithAInMiddle = "QH KH AH 2H 3H"; String hand = "2C AC QC 10C KC"; @@ -325,6 +361,7 @@ public void acesCannotBeInMiddleOfStraightFlush() { @Disabled("Remove to run test") @Test + @DisplayName("both hands have a straight flush, tie goes to highest-ranked card") public void twoStraightFlushes() { String straightFlushTo8 = "4H 6H 7H 8H 5H"; String straightFlushTo9 = "5S 7S 8S 9S 6S"; @@ -334,6 +371,7 @@ public void twoStraightFlushes() { @Disabled("Remove to run test") @Test + @DisplayName("even though an ace is usually high, a 5-high straight flush is the lowest-scoring straight flush") public void straightFlushTo5IsTheLowestScoring() { String straightFlushTo6 = "2H 3H 4H 5H 6H"; String straightFlushTo5 = "4D AD 3D 2D 5D"; diff --git a/exercises/practice/robot-name/src/test/java/RobotTest.java b/exercises/practice/robot-name/src/test/java/RobotTest.java index 6c19ae877..542d4a586 100644 --- a/exercises/practice/robot-name/src/test/java/RobotTest.java +++ b/exercises/practice/robot-name/src/test/java/RobotTest.java @@ -1,11 +1,12 @@ -import static org.assertj.core.api.Assertions.assertThat; +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 java.util.HashSet; import java.util.Set; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; public class RobotTest { @@ -18,24 +19,28 @@ public void setUp() { } @Test + @DisplayName("Robot has a valid name") public void hasName() { assertIsValidName(robot.getName()); } @Test @Disabled("Remove to run test") + @DisplayName("Same robot returns the same name on repeated calls") public void sameRobotsHaveSameNames() { assertThat(robot.getName()).isEqualTo(robot.getName()); } @Disabled("Remove to run test") @Test + @DisplayName("Different robots have different names") public void differentRobotsHaveDifferentNames() { assertThat(robot.getName()).isNotEqualTo(new Robot().getName()); } @Disabled("Remove to run test") @Test + @DisplayName("Resetting a robot assigns a new valid name") public void resetName() { final String name = robot.getName(); robot.reset(); @@ -46,6 +51,7 @@ public void resetName() { @Disabled("Remove to run test") @Test + @DisplayName("Robot names are unique") public void robotNamesAreUnique() { Set robotNames = new HashSet<>(); int sampleSize = 5000; diff --git a/exercises/practice/simple-linked-list/src/test/java/SimpleLinkedListTest.java b/exercises/practice/simple-linked-list/src/test/java/SimpleLinkedListTest.java index 76e219ff8..109d3b3a7 100644 --- a/exercises/practice/simple-linked-list/src/test/java/SimpleLinkedListTest.java +++ b/exercises/practice/simple-linked-list/src/test/java/SimpleLinkedListTest.java @@ -1,14 +1,16 @@ -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.util.NoSuchElementException; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + public class SimpleLinkedListTest { @Test + @DisplayName("A new list is empty") public void aNewListIsEmpty() { SimpleLinkedList list = new SimpleLinkedList<>(); assertThat(list.size()).isEqualTo(0); @@ -16,6 +18,7 @@ public void aNewListIsEmpty() { @Disabled("Remove to run test") @Test + @DisplayName("Create list from array") public void canCreateFromArray() { Character[] values = new Character[]{'1', '2', '3'}; SimpleLinkedList list = new SimpleLinkedList(values); @@ -24,6 +27,7 @@ public void canCreateFromArray() { @Disabled("Remove to run test") @Test + @DisplayName("Popping an empty list throws NoSuchElementException") public void popOnEmptyListWillThrow() { SimpleLinkedList list = new SimpleLinkedList(); @@ -32,6 +36,7 @@ public void popOnEmptyListWillThrow() { @Disabled("Remove to run test") @Test + @DisplayName("Pop returns last added element (LIFO)") public void popReturnsLastAddedElement() { SimpleLinkedList list = new SimpleLinkedList(); list.push(9); @@ -44,6 +49,7 @@ public void popReturnsLastAddedElement() { @Disabled("Remove to run test") @Test + @DisplayName("Reverse reverses the list order") public void reverseReversesList() { SimpleLinkedList list = new SimpleLinkedList(); list.push("9"); @@ -61,6 +67,7 @@ public void reverseReversesList() { @Disabled("Remove to run test") @Test + @DisplayName("Can return list as an array") public void canReturnListAsArray() { SimpleLinkedList list = new SimpleLinkedList(); list.push('9'); @@ -74,6 +81,7 @@ public void canReturnListAsArray() { @Disabled("Remove to run test") @Test + @DisplayName("Can return empty list as an empty array") public void canReturnEmptyListAsEmptyArray() { SimpleLinkedList list = new SimpleLinkedList(); Object[] expected = {};