diff --git a/exercises/practice/ledger/src/test/java/LedgerTest.java b/exercises/practice/ledger/src/test/java/LedgerTest.java index eb7cbfddb..15c022ee4 100644 --- a/exercises/practice/ledger/src/test/java/LedgerTest.java +++ b/exercises/practice/ledger/src/test/java/LedgerTest.java @@ -1,7 +1,8 @@ -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -23,6 +24,7 @@ public void setUp() throws Exception { @Disabled("Remove to run test") @Test + @DisplayName("empty ledger") public void emptyLedgerUS() { var entries = new Ledger.LedgerEntry[] {}; @@ -34,6 +36,7 @@ public void emptyLedgerUS() { @Disabled("Remove to run test") @Test + @DisplayName("one entry") public void oneEntry() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-01", "Buy present", -1000) @@ -48,6 +51,7 @@ public void oneEntry() { @Disabled("Remove to run test") @Test + @DisplayName("credit and debit") public void creditAndDebit() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-02", "Get present", 1000), @@ -65,6 +69,7 @@ public void creditAndDebit() { @Disabled("Remove to run test") @Test + @DisplayName("multiple entries on same date ordered by description") public void multipleEntriesOnSameDateOrderedByDescription() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-01", "Get present", 1000), @@ -82,6 +87,7 @@ public void multipleEntriesOnSameDateOrderedByDescription() { @Disabled("Remove to run test") @Test + @DisplayName("final order tie breaker is change") public void finalOrderTieBreakerIsChange() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-01", "Something", 0), @@ -101,6 +107,7 @@ public void finalOrderTieBreakerIsChange() { @Disabled("Remove to run test") @Test + @DisplayName("overlong description is truncated") public void overlongDescriptions() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-01", "Freude schoner Gotterfunken", -123456) @@ -116,6 +123,7 @@ public void overlongDescriptions() { @Disabled("Remove to run test") @Test + @DisplayName("euros") public void euros() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-01-01", "Buy present", -1000) @@ -131,6 +139,7 @@ public void euros() { @Disabled("Remove to run test") @Test + @DisplayName("Dutch locale") public void dutchLocale() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-03-12", "Buy present", 123456) @@ -146,6 +155,7 @@ public void dutchLocale() { @Disabled("Remove to run test") @Test + @DisplayName("Dutch locale and euros") public void dutchLocaleAndEuros() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-03-12", "Buy present", 123456) @@ -161,6 +171,7 @@ public void dutchLocaleAndEuros() { @Disabled("Remove to run test") @Test + @DisplayName("Dutch negative number with 3 digits before decimal point") public void dutchNegativeNumberWith3DigitsBeforeDecimalPoint() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-03-12", "Buy present", -12345) @@ -176,6 +187,7 @@ public void dutchNegativeNumberWith3DigitsBeforeDecimalPoint() { @Disabled("Remove to run test") @Test + @DisplayName("American negative number with 3 digits before decimal point") public void americanNegativeNumberWith3DigitsBeforeDecimalPoint() { var entries = new Ledger.LedgerEntry[] { ledger.createLedgerEntry("2015-03-12", "Buy present", -12345) diff --git a/exercises/practice/linked-list/src/test/java/DoublyLinkedListTest.java b/exercises/practice/linked-list/src/test/java/DoublyLinkedListTest.java index b36e5b988..365d92088 100644 --- a/exercises/practice/linked-list/src/test/java/DoublyLinkedListTest.java +++ b/exercises/practice/linked-list/src/test/java/DoublyLinkedListTest.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 DoublyLinkedListTest { @Test + @DisplayName("pop gets element from the list") public void popGetsElementFromTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -16,6 +18,7 @@ public void popGetsElementFromTheList() { @Disabled("Remove to run test") @Test + @DisplayName("push/pop respectively add/remove at the end of the list") public void pushAndPopRespectivelyAddsAndRemovesAtEndOfList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -28,6 +31,7 @@ public void pushAndPopRespectivelyAddsAndRemovesAtEndOfList() { @Disabled("Remove to run test") @Test + @DisplayName("shift gets an element from the list") public void shiftGetsAnElementFromTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -38,6 +42,7 @@ public void shiftGetsAnElementFromTheList() { @Disabled("Remove to run test") @Test + @DisplayName("shift gets first element from the list") public void shiftGetsFirstElementFromTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -50,6 +55,7 @@ public void shiftGetsFirstElementFromTheList() { @Disabled("Remove to run test") @Test + @DisplayName("unshift adds element at start of the list") public void unshiftAddsElementAtStartOfTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -62,6 +68,7 @@ public void unshiftAddsElementAtStartOfTheList() { @Disabled("Remove to run test") @Test + @DisplayName("pop push shift unshift can be used in any order") public void popPushShiftUnshiftCanBeUsedInAnyOrder() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -84,6 +91,7 @@ public void popPushShiftUnshiftCanBeUsedInAnyOrder() { @Disabled("Remove to run test") @Test + @DisplayName("popping to empty doesn't break the list") public void poppingToEmptyDoesNotBreakTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); @@ -98,6 +106,7 @@ public void poppingToEmptyDoesNotBreakTheList() { @Disabled("Remove to run test") @Test + @DisplayName("shifting to empty doesn't break the list") public void shiftingToEmptyDoesNotBreakTheList() { DoublyLinkedList list = new DoublyLinkedList<>(); diff --git a/exercises/practice/list-ops/src/test/java/ListOpsTest.java b/exercises/practice/list-ops/src/test/java/ListOpsTest.java index f1eb87051..dc44c61da 100644 --- a/exercises/practice/list-ops/src/test/java/ListOpsTest.java +++ b/exercises/practice/list-ops/src/test/java/ListOpsTest.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; @@ -8,12 +9,14 @@ public class ListOpsTest { @Test + @DisplayName("empty lists") public void testAppendingEmptyLists() { assertThat(ListOps.append(List.of(), List.of())).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("list to empty list") public void testAppendingListToEmptyList() { assertThat(ListOps.append(List.of(), List.of('1', '2', '3', '4'))) .containsExactly('1', '2', '3', '4'); @@ -21,6 +24,7 @@ public void testAppendingListToEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("empty list to list") public void testAppendingEmptyListToList() { assertThat(ListOps.append(List.of('1', '2', '3', '4'), List.of())) .containsExactly('1', '2', '3', '4'); @@ -28,6 +32,7 @@ public void testAppendingEmptyListToList() { @Disabled("Remove to run test") @Test + @DisplayName("non-empty lists") public void testAppendingNonEmptyLists() { assertThat(ListOps.append(List.of("1", "2"), List.of("2", "3", "4", "5"))) .containsExactly("1", "2", "2", "3", "4", "5"); @@ -35,12 +40,14 @@ public void testAppendingNonEmptyLists() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testConcatEmptyList() { assertThat(ListOps.concat(List.of())).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("list of lists") public void testConcatListOfLists() { List> listOfLists = List.of( List.of('1', '2'), @@ -54,6 +61,7 @@ public void testConcatListOfLists() { @Disabled("Remove to run test") @Test + @DisplayName("list of nested lists") public void testConcatListOfNestedLists() { List>> listOfNestedLists = List.of( List.of( @@ -82,6 +90,7 @@ public void testConcatListOfNestedLists() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testFilteringEmptyList() { assertThat(ListOps.filter(List.of(), integer -> integer % 2 == 1)) .isEmpty(); @@ -89,6 +98,7 @@ public void testFilteringEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("non-empty list") public void testFilteringNonEmptyList() { assertThat(ListOps.filter(List.of(1, 2, 3, 5), integer -> integer % 2 == 1)) .containsExactly(1, 3, 5); @@ -96,24 +106,28 @@ public void testFilteringNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testSizeOfEmptyList() { assertThat(ListOps.size(List.of())).isEqualTo(0); } @Disabled("Remove to run test") @Test + @DisplayName("non-empty list") public void testSizeOfNonEmptyList() { assertThat(ListOps.size(List.of("one", "two", "three", "four"))).isEqualTo(4); } @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testTransformingEmptyList() { assertThat(ListOps.map(List.of(), integer -> integer + 1)).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("non-empty list") public void testTransformingNonEmptyList() { assertThat(ListOps.map(List.of(1, 3, 5, 7), integer -> integer + 1)) .containsExactly(2, 4, 6, 8); @@ -121,6 +135,7 @@ public void testTransformingNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testFoldLeftEmptyList() { assertThat( ListOps.foldLeft( @@ -132,6 +147,7 @@ public void testFoldLeftEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("direction independent function applied to non-empty list") public void testFoldLeftDirectionIndependentFunctionAppliedToNonEmptyList() { assertThat( ListOps.foldLeft( @@ -143,6 +159,7 @@ public void testFoldLeftDirectionIndependentFunctionAppliedToNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("direction dependent function applied to non-empty list") public void testFoldLeftDirectionDependentFunctionAppliedToNonEmptyList() { assertThat( ListOps.foldLeft( @@ -154,6 +171,7 @@ public void testFoldLeftDirectionDependentFunctionAppliedToNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testFoldRightEmptyList() { assertThat( ListOps.foldRight( @@ -165,6 +183,7 @@ public void testFoldRightEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("direction independent function applied to non-empty list") public void testFoldRightDirectionIndependentFunctionAppliedToNonEmptyList() { assertThat( ListOps.foldRight( @@ -176,6 +195,7 @@ public void testFoldRightDirectionIndependentFunctionAppliedToNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("direction dependent function applied to non-empty list") public void testFoldRightDirectionDependentFunctionAppliedToNonEmptyList() { assertThat( ListOps.foldRight( @@ -187,12 +207,14 @@ public void testFoldRightDirectionDependentFunctionAppliedToNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("empty list") public void testReversingEmptyList() { assertThat(ListOps.reverse(List.of())).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("non-empty list") public void testReversingNonEmptyList() { assertThat(ListOps.reverse(List.of('1', '3', '5', '7'))) .containsExactly('7', '5', '3', '1'); @@ -200,6 +222,7 @@ public void testReversingNonEmptyList() { @Disabled("Remove to run test") @Test + @DisplayName("list of lists is not flattened") public void testReversingListOfListIsNotFlattened() { List> listOfLists = List.of( List.of('1', '2'),