From fdac2e8c79693b99cc31be280110a1f36a4a6dba Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Tue, 26 Aug 2025 16:26:25 +0530 Subject: [PATCH 1/7] alphametics, anagram, armstrong-numbers, atbash-cipher --- .../src/test/java/AlphameticsTest.java | 11 +++++++++++ .../anagram/src/test/java/AnagramTest.java | 19 +++++++++++++++++++ .../src/test/java/ArmstrongNumbersTest.java | 10 ++++++++++ .../src/test/java/AtbashTest.java | 15 +++++++++++++++ 4 files changed, 55 insertions(+) diff --git a/exercises/practice/alphametics/src/test/java/AlphameticsTest.java b/exercises/practice/alphametics/src/test/java/AlphameticsTest.java index 93aef51be..c83aa0158 100644 --- a/exercises/practice/alphametics/src/test/java/AlphameticsTest.java +++ b/exercises/practice/alphametics/src/test/java/AlphameticsTest.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 java.util.Map.entry; @@ -8,6 +9,7 @@ public class AlphameticsTest { @Test + @DisplayName("puzzle with three letters") public void testThreeLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("I + BB == ILL").solve()) .containsOnly( @@ -18,6 +20,7 @@ public void testThreeLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("solution must have unique value for each letter") public void testUniqueValue() { Alphametics alphametics = new Alphametics("A == B"); @@ -27,6 +30,7 @@ public void testUniqueValue() { @Disabled("Remove to run test") @Test + @DisplayName("leading zero solution is invalid") public void testLeadingZero() { Alphametics alphametics = new Alphametics("ACA + DD == BD"); @@ -36,6 +40,7 @@ public void testLeadingZero() { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with two digits final carry") public void testTwoDigitsFinalCarry() throws UnsolvablePuzzleException { assertThat(new Alphametics("A + A + A + A + A + A + A + A + A + A + A + B == BCC").solve()) .containsOnly( @@ -46,6 +51,7 @@ public void testTwoDigitsFinalCarry() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with four letters") public void testFourLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("AS + A == MOM").solve()) .containsOnly( @@ -57,6 +63,7 @@ public void testFourLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with six letters") public void testSixLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("NO + NO + TOO == LATE").solve()) .containsOnly( @@ -70,6 +77,7 @@ public void testSixLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with seven letters") public void testSevenLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("HE + SEES + THE == LIGHT").solve()) .containsOnly( @@ -84,6 +92,7 @@ public void testSevenLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with eight letters") public void testEightLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("SEND + MORE == MONEY").solve()) .containsOnly( @@ -99,6 +108,7 @@ public void testEightLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with ten letters") public void testTenLetters() throws UnsolvablePuzzleException { assertThat(new Alphametics("AND + A + STRONG + OFFENSE + AS + A + GOOD == DEFENSE").solve()) .containsOnly( @@ -116,6 +126,7 @@ public void testTenLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test + @DisplayName("puzzle with ten letters and 199 addends") public void testTenLetters41Addends() throws UnsolvablePuzzleException { assertThat(new Alphametics("THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL + A + " + "TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE + THE + TALE + OF + THE + LAST + FIRE + " + diff --git a/exercises/practice/anagram/src/test/java/AnagramTest.java b/exercises/practice/anagram/src/test/java/AnagramTest.java index e5434291a..79a3a261b 100644 --- a/exercises/practice/anagram/src/test/java/AnagramTest.java +++ b/exercises/practice/anagram/src/test/java/AnagramTest.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; @@ -9,6 +10,7 @@ public class AnagramTest { @Test + @DisplayName("no matches") public void testNoMatches() { Anagram detector = new Anagram("diaper"); @@ -20,6 +22,7 @@ public void testNoMatches() { @Disabled("Remove to run test") @Test + @DisplayName("detects two anagrams") public void testDetectsTwoAnagrams() { Anagram detector = new Anagram("solemn"); @@ -29,6 +32,7 @@ public void testDetectsTwoAnagrams() { @Disabled("Remove to run test") @Test + @DisplayName("does not detect anagram subsets") public void testEliminateAnagramSubsets() { Anagram detector = new Anagram("good"); @@ -37,6 +41,7 @@ public void testEliminateAnagramSubsets() { @Disabled("Remove to run test") @Test + @DisplayName("detects anagram") public void testDetectLongerAnagram() { Anagram detector = new Anagram("listen"); @@ -48,6 +53,7 @@ public void testDetectLongerAnagram() { @Disabled("Remove to run test") @Test + @DisplayName("detects three anagrams") public void testDetectMultipleAnagramsForLongerWord() { Anagram detector = new Anagram("allergy"); assertThat( @@ -64,6 +70,7 @@ public void testDetectMultipleAnagramsForLongerWord() { @Disabled("Remove to run test") @Test + @DisplayName("detects multiple anagrams with different case") public void testDetectsMultipleAnagramsWithDifferentCase() { Anagram detector = new Anagram("nose"); @@ -73,6 +80,7 @@ public void testDetectsMultipleAnagramsWithDifferentCase() { @Disabled("Remove to run test") @Test + @DisplayName("does not detect non-anagrams with identical checksum") public void testEliminateAnagramsWithSameChecksum() { Anagram detector = new Anagram("mass"); @@ -82,6 +90,7 @@ public void testEliminateAnagramsWithSameChecksum() { @Disabled("Remove to run test") @Test + @DisplayName("detects anagrams case-insensitively") public void testCaseInsensitiveWhenBothAnagramAndSubjectStartWithUpperCaseLetter() { Anagram detector = new Anagram("Orchestra"); @@ -93,6 +102,7 @@ public void testCaseInsensitiveWhenBothAnagramAndSubjectStartWithUpperCaseLetter @Disabled("Remove to run test") @Test + @DisplayName("detects anagrams using case-insensitive subject") public void testCaseInsensitiveWhenSubjectStartsWithUpperCaseLetter() { Anagram detector = new Anagram("Orchestra"); @@ -104,6 +114,7 @@ public void testCaseInsensitiveWhenSubjectStartsWithUpperCaseLetter() { @Disabled("Remove to run test") @Test + @DisplayName("detects anagrams using case-insensitive possible matches") public void testCaseInsensitiveWhenAnagramStartsWithUpperCaseLetter() { Anagram detector = new Anagram("orchestra"); @@ -115,6 +126,7 @@ public void testCaseInsensitiveWhenAnagramStartsWithUpperCaseLetter() { @Disabled("Remove to run test") @Test + @DisplayName("does not detect an anagram if the original word is repeated") public void testIdenticalWordRepeatedIsNotAnagram() { Anagram detector = new Anagram("go"); @@ -124,6 +136,7 @@ public void testIdenticalWordRepeatedIsNotAnagram() { @Disabled("Remove to run test") @Test + @DisplayName("anagrams must use all letters exactly once") public void testAnagramMustUseAllLettersExactlyOnce() { Anagram detector = new Anagram("tapper"); @@ -133,6 +146,7 @@ public void testAnagramMustUseAllLettersExactlyOnce() { @Disabled("Remove to run test") @Test + @DisplayName("words are not anagrams of themselves") public void testWordsAreNotAnagramsOfThemselvesCaseInsensitive() { Anagram detector = new Anagram("BANANA"); @@ -142,6 +156,7 @@ public void testWordsAreNotAnagramsOfThemselvesCaseInsensitive() { @Disabled("Remove to run test") @Test + @DisplayName("words are not anagrams of themselves even if letter case is partially different") public void testWordsAreNotAnagramsOfThemselvesEvenIfLetterCaseIsPartiallyDifferent() { Anagram detector = new Anagram("BANANA"); @@ -151,6 +166,7 @@ public void testWordsAreNotAnagramsOfThemselvesEvenIfLetterCaseIsPartiallyDiffer @Disabled("Remove to run test") @Test + @DisplayName("words are not anagrams of themselves even if letter case is completely different") public void testWordsAreNotAnagramsOfThemselvesEvenIfLetterCaseIsCompletelyDifferent() { Anagram detector = new Anagram("BANANA"); @@ -160,6 +176,7 @@ public void testWordsAreNotAnagramsOfThemselvesEvenIfLetterCaseIsCompletelyDiffe @Disabled("Remove to run test") @Test + @DisplayName("words other than themselves can be anagrams") public void testWordsOtherThanThemselvesCanBeAnagrams() { Anagram detector = new Anagram("LISTEN"); @@ -169,6 +186,7 @@ public void testWordsOtherThanThemselvesCanBeAnagrams() { @Disabled("Remove to run test") @Test + @DisplayName("handles case of greek letters") public void testHandlesCaseOfGreekLetters() { Anagram detector = new Anagram("ΑΒΓ"); @@ -178,6 +196,7 @@ public void testHandlesCaseOfGreekLetters() { @Disabled("Remove to run test") @Test + @DisplayName("different characters may have the same bytes") public void testDifferentCharactersWithSameBytes() { Anagram detector = new Anagram("a⬂"); diff --git a/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java b/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java index ea08d7259..ca890915d 100644 --- a/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java +++ b/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.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("Zero is an Armstrong number") public void zeroIsArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(0)) .isTrue(); @@ -21,6 +23,7 @@ public void zeroIsArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Single-digit numbers are Armstrong numbers") public void singleDigitsAreArmstrongNumbers() { assertThat(armstrongNumbers.isArmstrongNumber(5)) .isTrue(); @@ -28,6 +31,7 @@ public void singleDigitsAreArmstrongNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("There are no two-digit Armstrong numbers") public void noTwoDigitArmstrongNumbers() { assertThat(armstrongNumbers.isArmstrongNumber(10)) .isFalse(); @@ -35,6 +39,7 @@ public void noTwoDigitArmstrongNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("Three-digit number that is an Armstrong number") public void threeDigitNumberIsArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(153)) .isTrue(); @@ -42,6 +47,7 @@ public void threeDigitNumberIsArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Three-digit number that is not an Armstrong number") public void threeDigitNumberIsNotArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(100)) .isFalse(); @@ -49,6 +55,7 @@ public void threeDigitNumberIsNotArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Four-digit number that is an Armstrong number") public void fourDigitNumberIsArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9474)) .isTrue(); @@ -56,6 +63,7 @@ public void fourDigitNumberIsArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("") public void fourDigitNumberIsNotArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9475)) .isFalse(); @@ -63,6 +71,7 @@ public void fourDigitNumberIsNotArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Four-digit number that is not an Armstrong number") public void sevenDigitNumberIsArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9926315)) .isTrue(); @@ -70,6 +79,7 @@ public void sevenDigitNumberIsArmstrongNumber() { @Disabled("Remove to run test") @Test + @DisplayName("Seven-digit number that is not an Armstrong number") public void sevenDigitNumberIsNotArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9926314)) .isFalse(); diff --git a/exercises/practice/atbash-cipher/src/test/java/AtbashTest.java b/exercises/practice/atbash-cipher/src/test/java/AtbashTest.java index f656a69dc..c914f8b28 100644 --- a/exercises/practice/atbash-cipher/src/test/java/AtbashTest.java +++ b/exercises/practice/atbash-cipher/src/test/java/AtbashTest.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,36 +15,42 @@ public void setup() { } @Test + @DisplayName("encode yes") public void testEncodeYes() { assertThat(atbash.encode("yes")).isEqualTo("bvh"); } @Disabled("Remove to run test") @Test + @DisplayName("encode no") public void testEncodeNo() { assertThat(atbash.encode("no")).isEqualTo("ml"); } @Disabled("Remove to run test") @Test + @DisplayName("encode OMG") public void testEncodeOmgInCapital() { assertThat(atbash.encode("OMG")).isEqualTo("lnt"); } @Disabled("Remove to run test") @Test + @DisplayName("encode spaces") public void testEncodeOmgWithSpaces() { assertThat(atbash.encode("O M G")).isEqualTo("lnt"); } @Disabled("Remove to run test") @Test + @DisplayName("encode mindblowingly") public void testEncodeMindBlowingly() { assertThat(atbash.encode("mindblowingly")).isEqualTo("nrmwy oldrm tob"); } @Disabled("Remove to run test") @Test + @DisplayName("encode numbers") public void testEncodeNumbers() { assertThat(atbash.encode("Testing,1 2 3, testing.")) .isEqualTo("gvhgr mt123 gvhgr mt"); @@ -51,6 +58,7 @@ public void testEncodeNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("encode deep thought") public void testEncodeDeepThought() { assertThat(atbash.encode("Truth is fiction.")) .isEqualTo("gifgs rhurx grlm"); @@ -58,6 +66,7 @@ public void testEncodeDeepThought() { @Disabled("Remove to run test") @Test + @DisplayName("encode all the letters") public void testEncodeAllTheLetters() { assertThat(atbash.encode("The quick brown fox jumps over the lazy dog.")) .isEqualTo("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"); @@ -65,12 +74,14 @@ public void testEncodeAllTheLetters() { @Disabled("Remove to run test") @Test + @DisplayName("decode exercism") public void testDecodeExercism() { assertThat(atbash.decode("vcvix rhn")).isEqualTo("exercism"); } @Disabled("Remove to run test") @Test + @DisplayName("decode a sentence") public void testDecodeASentence() { assertThat(atbash.decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v")) .isEqualTo("anobstacleisoftenasteppingstone"); @@ -78,6 +89,7 @@ public void testDecodeASentence() { @Disabled("Remove to run test") @Test + @DisplayName("decode numbers") public void testDecodeNumbers() { assertThat(atbash.decode("gvhgr mt123 gvhgr mt")) .isEqualTo("testing123testing"); @@ -85,6 +97,7 @@ public void testDecodeNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("decode all the letters") public void testDecodeAllTheLetters() { assertThat(atbash.decode("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")) .isEqualTo("thequickbrownfoxjumpsoverthelazydog"); @@ -92,12 +105,14 @@ public void testDecodeAllTheLetters() { @Disabled("Remove to run test") @Test + @DisplayName("decode with too many spaces") public void testDecodeWithTooManySpaces() { assertThat(atbash.decode("vc vix r hn")).isEqualTo("exercism"); } @Disabled("Remove to run test") @Test + @DisplayName("decode with no spaces") public void testDecodeWithNoSpaces() { assertThat(atbash.decode("zmlyhgzxovrhlugvmzhgvkkrmthglmv")) .isEqualTo("anobstacleisoftenasteppingstone"); From 9a915e02ad5593c16ae5fa6d5eda4d47e421e7e1 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Wed, 27 Aug 2025 14:15:58 +0530 Subject: [PATCH 2/7] alphametics, armstrong-numbers --- .../practice/alphametics/src/test/java/AlphameticsTest.java | 2 +- .../armstrong-numbers/src/test/java/ArmstrongNumbersTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/practice/alphametics/src/test/java/AlphameticsTest.java b/exercises/practice/alphametics/src/test/java/AlphameticsTest.java index c83aa0158..8661a8de3 100644 --- a/exercises/practice/alphametics/src/test/java/AlphameticsTest.java +++ b/exercises/practice/alphametics/src/test/java/AlphameticsTest.java @@ -127,7 +127,7 @@ public void testTenLetters() throws UnsolvablePuzzleException { @Disabled("Remove to run test") @Test @DisplayName("puzzle with ten letters and 199 addends") - public void testTenLetters41Addends() throws UnsolvablePuzzleException { + public void testTenLetters199Addends() throws UnsolvablePuzzleException { assertThat(new Alphametics("THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL + A + " + "TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE + THE + TALE + OF + THE + LAST + FIRE + " + "HORSES + LATE + AFTER + THE + FIRST + FATHERS + FORESEE + THE + HORRORS + THE + LAST + FREE + " + diff --git a/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java b/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java index ca890915d..8977970dc 100644 --- a/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java +++ b/exercises/practice/armstrong-numbers/src/test/java/ArmstrongNumbersTest.java @@ -63,7 +63,7 @@ public void fourDigitNumberIsArmstrongNumber() { @Disabled("Remove to run test") @Test - @DisplayName("") + @DisplayName("Four-digit number that is not an Armstrong number") public void fourDigitNumberIsNotArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9475)) .isFalse(); @@ -71,7 +71,7 @@ public void fourDigitNumberIsNotArmstrongNumber() { @Disabled("Remove to run test") @Test - @DisplayName("Four-digit number that is not an Armstrong number") + @DisplayName("Seven-digit number that is an Armstrong number") public void sevenDigitNumberIsArmstrongNumber() { assertThat(armstrongNumbers.isArmstrongNumber(9926315)) .isTrue(); From a50761eeae3466c3bc495e5edc5dca9c7a813e08 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Fri, 29 Aug 2025 18:12:41 +0530 Subject: [PATCH 3/7] bank-account, binary-search-tree, binary-search, bob, book-store --- .../src/test/java/BankAccountTest.java | 20 +++++++++++++- .../src/test/java/BinarySearchTreeTest.java | 11 ++++++++ .../src/test/java/BinarySearchTest.java | 12 +++++++++ .../practice/bob/src/test/java/BobTest.java | 26 +++++++++++++++++++ .../src/test/java/BookStoreTest.java | 19 ++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) diff --git a/exercises/practice/bank-account/src/test/java/BankAccountTest.java b/exercises/practice/bank-account/src/test/java/BankAccountTest.java index 35b4e04a0..8c6d65de7 100644 --- a/exercises/practice/bank-account/src/test/java/BankAccountTest.java +++ b/exercises/practice/bank-account/src/test/java/BankAccountTest.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.Random; @@ -15,6 +16,7 @@ public void setUp() { } @Test + @DisplayName("Newly opened account has zero balance") public void newlyOpenedAccountHasEmptyBalance() throws BankAccountActionInvalidException { bankAccount.open(); @@ -23,6 +25,7 @@ public void newlyOpenedAccountHasEmptyBalance() throws BankAccountActionInvalidE @Disabled("Remove to run test") @Test + @DisplayName("Single deposit") public void singleDeposit() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -32,6 +35,7 @@ public void singleDeposit() throws BankAccountActionInvalidException { @Disabled("Remove to run test") @Test + @DisplayName("Multiple deposits") public void multipleDeposits() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -42,6 +46,7 @@ public void multipleDeposits() throws BankAccountActionInvalidException { @Disabled("Remove to run test") @Test + @DisplayName("Withdraw once") public void withdrawOnce() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -52,6 +57,7 @@ public void withdrawOnce() throws BankAccountActionInvalidException { @Disabled("Remove to run test") @Test + @DisplayName("Withdraw twice") public void withdrawTwice() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -63,6 +69,7 @@ public void withdrawTwice() throws BankAccountActionInvalidException { @Disabled("Remove to run test") @Test + @DisplayName("Can do multiple operations sequentially") public void canDoMultipleOperationsSequentially() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -76,6 +83,7 @@ public void canDoMultipleOperationsSequentially() throws BankAccountActionInvali @Disabled("Remove to run test") @Test + @DisplayName("Cannot check balance of closed account") public void cannotCheckBalanceOfClosedAccount() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.close(); @@ -87,6 +95,7 @@ public void cannotCheckBalanceOfClosedAccount() throws BankAccountActionInvalidE @Disabled("Remove to run test") @Test + @DisplayName("Cannot deposit into closed account") public void cannotDepositIntoClosedAccount() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.close(); @@ -98,6 +107,7 @@ public void cannotDepositIntoClosedAccount() throws BankAccountActionInvalidExce @Disabled("Remove to run test") @Test + @DisplayName("Cannot deposit into unopened account") public void cannotDepositIntoUnopenedAccount() { assertThatExceptionOfType(BankAccountActionInvalidException.class) .isThrownBy(() -> bankAccount.deposit(50)) @@ -106,6 +116,7 @@ public void cannotDepositIntoUnopenedAccount() { @Disabled("Remove to run test") @Test + @DisplayName("Cannot withdraw from closed account") public void cannotWithdrawFromClosedAccount() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.close(); @@ -117,6 +128,7 @@ public void cannotWithdrawFromClosedAccount() throws BankAccountActionInvalidExc @Disabled("Remove to run test") @Test + @DisplayName("Cannot close an account that was not opened") public void cannotCloseAnAccountThatWasNotOpened() { assertThatExceptionOfType(BankAccountActionInvalidException.class) .isThrownBy(bankAccount::close) @@ -125,6 +137,7 @@ public void cannotCloseAnAccountThatWasNotOpened() { @Disabled("Remove to run test") @Test + @DisplayName("Cannot open an already opened account") public void cannotOpenAnAlreadyOpenedAccount() throws BankAccountActionInvalidException { bankAccount.open(); @@ -135,6 +148,7 @@ public void cannotOpenAnAlreadyOpenedAccount() throws BankAccountActionInvalidEx @Disabled("Remove to run test") @Test + @DisplayName("Reopened account does not retain balance") public void reopenedAccountDoesNotRetainBalance() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(50); @@ -146,7 +160,8 @@ public void reopenedAccountDoesNotRetainBalance() throws BankAccountActionInvali @Disabled("Remove to run test") @Test - public void cannotWithdrawMoreThanWasDeposited() throws BankAccountActionInvalidException { + @DisplayName("Cannot withdraw more than deposited") + public void cannotWithdrawMoreThanDeposited() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(25); @@ -157,6 +172,7 @@ public void cannotWithdrawMoreThanWasDeposited() throws BankAccountActionInvalid @Disabled("Remove to run test") @Test + @DisplayName("Cannot withdraw negative") public void cannotWithdrawNegativeAmount() throws BankAccountActionInvalidException { bankAccount.open(); bankAccount.deposit(100); @@ -168,6 +184,7 @@ public void cannotWithdrawNegativeAmount() throws BankAccountActionInvalidExcept @Disabled("Remove to run test") @Test + @DisplayName("Cannot deposit negative") public void cannotDepositNegativeAmount() throws BankAccountActionInvalidException { bankAccount.open(); @@ -178,6 +195,7 @@ public void cannotDepositNegativeAmount() throws BankAccountActionInvalidExcepti @Disabled("Remove to run test") @Test + @DisplayName("Can handle concurrent transactions") public void canHandleConcurrentTransactions() throws BankAccountActionInvalidException, InterruptedException { bankAccount.open(); bankAccount.deposit(1000); diff --git a/exercises/practice/binary-search-tree/src/test/java/BinarySearchTreeTest.java b/exercises/practice/binary-search-tree/src/test/java/BinarySearchTreeTest.java index 1d16df93c..f6d8f1478 100644 --- a/exercises/practice/binary-search-tree/src/test/java/BinarySearchTreeTest.java +++ b/exercises/practice/binary-search-tree/src/test/java/BinarySearchTreeTest.java @@ -4,11 +4,13 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; public class BinarySearchTreeTest { @Test + @DisplayName("data is retained") public void dataIsRetained() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); @@ -24,6 +26,7 @@ public void dataIsRetained() { @Disabled("Remove to run test") @Test + @DisplayName("insert data at proper node") public void insertsLess() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); @@ -45,6 +48,7 @@ public void insertsLess() { @Disabled("Remove to run test") @Test + @DisplayName("same number at left node") public void insertsSame() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); String expectedRoot = "4"; @@ -65,6 +69,7 @@ public void insertsSame() { @Disabled("Remove to run test") @Test + @DisplayName("greater number at right node") public void insertsRight() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); int expectedRoot = 4; @@ -85,6 +90,7 @@ public void insertsRight() { @Disabled("Remove to run test") @Test + @DisplayName("can create complex tree") public void createsComplexTree() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = List.of('4', '2', '6', '1', '3', '5', '7'); @@ -97,6 +103,7 @@ public void createsComplexTree() { @Disabled("Remove to run test") @Test + @DisplayName("can sort single number") public void sortsSingleElement() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = Collections.singletonList("2"); @@ -108,6 +115,7 @@ public void sortsSingleElement() { @Disabled("Remove to run test") @Test + @DisplayName("can sort if second number is smaller than first") public void sortsCollectionOfTwoIfSecondInsertedIsSmallerThanFirst() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = List.of(1, 2); @@ -120,6 +128,7 @@ public void sortsCollectionOfTwoIfSecondInsertedIsSmallerThanFirst() { @Disabled("Remove to run test") @Test + @DisplayName("can sort if second number is same as first") public void sortsCollectionOfTwoIfSecondNumberisSameAsFirst() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = List.of('2', '2'); @@ -132,6 +141,7 @@ public void sortsCollectionOfTwoIfSecondNumberisSameAsFirst() { @Disabled("Remove to run test") @Test + @DisplayName("can sort if second number is greater than first") public void sortsCollectionOfTwoIfSecondInsertedIsBiggerThanFirst() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = List.of('2', '3'); @@ -144,6 +154,7 @@ public void sortsCollectionOfTwoIfSecondInsertedIsBiggerThanFirst() { @Disabled("Remove to run test") @Test + @DisplayName("can sort complex tree") public void iteratesOverComplexTree() { BinarySearchTree binarySearchTree = new BinarySearchTree<>(); List expected = List.of("1", "2", "3", "5", "6", "7"); diff --git a/exercises/practice/binary-search/src/test/java/BinarySearchTest.java b/exercises/practice/binary-search/src/test/java/BinarySearchTest.java index f586f744c..ccb411198 100644 --- a/exercises/practice/binary-search/src/test/java/BinarySearchTest.java +++ b/exercises/practice/binary-search/src/test/java/BinarySearchTest.java @@ -2,6 +2,7 @@ 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.Collections; @@ -10,6 +11,7 @@ public class BinarySearchTest { @Test + @DisplayName("finds a value in an array with one element") public void findsAValueInAnArrayWithOneElement() throws ValueNotFoundException { List listOfUnitLength = Collections.singletonList(6); @@ -20,6 +22,7 @@ public void findsAValueInAnArrayWithOneElement() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("finds a value in the middle of an array") public void findsAValueInTheMiddleOfAnArray() throws ValueNotFoundException { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -30,6 +33,7 @@ public void findsAValueInTheMiddleOfAnArray() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("finds a value at the beginning of an array") public void findsAValueAtTheBeginningOfAnArray() throws ValueNotFoundException { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -40,6 +44,7 @@ public void findsAValueAtTheBeginningOfAnArray() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("finds a value at the end of an array") public void findsAValueAtTheEndOfAnArray() throws ValueNotFoundException { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -50,6 +55,7 @@ public void findsAValueAtTheEndOfAnArray() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("") public void findsAValueInAnArrayOfOddLength() throws ValueNotFoundException { List sortedListOfOddLength = List.of(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634); @@ -60,6 +66,7 @@ public void findsAValueInAnArrayOfOddLength() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("finds a value in an array of even length") public void findsAValueInAnArrayOfEvenLength() throws ValueNotFoundException { List sortedListOfEvenLength = List.of(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377); @@ -70,6 +77,7 @@ public void findsAValueInAnArrayOfEvenLength() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("identifies that a value is not included in the array") public void identifiesThatAValueIsNotFoundInTheArray() { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -82,6 +90,7 @@ public void identifiesThatAValueIsNotFoundInTheArray() { @Disabled("Remove to run test") @Test + @DisplayName("a value smaller than the array's smallest value is not found") public void aValueSmallerThanTheArraysSmallestValueIsNotFound() { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -94,6 +103,7 @@ public void aValueSmallerThanTheArraysSmallestValueIsNotFound() { @Disabled("Remove to run test") @Test + @DisplayName("a value larger than the array's largest value is not found") public void aValueLargerThanTheArraysLargestValueIsNotFound() throws ValueNotFoundException { List sortedList = List.of(1, 3, 4, 6, 8, 9, 11); @@ -106,6 +116,7 @@ public void aValueLargerThanTheArraysLargestValueIsNotFound() throws ValueNotFou @Disabled("Remove to run test") @Test + @DisplayName("nothing is found in an empty array") public void nothingIsFoundInAnEmptyArray() throws ValueNotFoundException { List emptyList = Collections.emptyList(); @@ -118,6 +129,7 @@ public void nothingIsFoundInAnEmptyArray() throws ValueNotFoundException { @Disabled("Remove to run test") @Test + @DisplayName("nothing is found when the left and right bounds cross") public void nothingIsFoundWhenTheLeftAndRightBoundCross() throws ValueNotFoundException { List sortedList = List.of(1, 2); diff --git a/exercises/practice/bob/src/test/java/BobTest.java b/exercises/practice/bob/src/test/java/BobTest.java index 801315b42..756fb93f8 100644 --- a/exercises/practice/bob/src/test/java/BobTest.java +++ b/exercises/practice/bob/src/test/java/BobTest.java @@ -1,5 +1,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.BeforeEach; import static org.assertj.core.api.Assertions.assertThat; @@ -14,6 +15,7 @@ public void setUp() { } @Test + @DisplayName("stating something") public void saySomething() { assertThat(bob.hey("Tom-ay-to, tom-aaaah-to.")) .isEqualTo("Whatever."); @@ -21,6 +23,7 @@ public void saySomething() { @Disabled("Remove to run test") @Test + @DisplayName("shouting") public void shouting() { assertThat(bob.hey("WATCH OUT!")) .isEqualTo("Whoa, chill out!"); @@ -28,6 +31,7 @@ public void shouting() { @Disabled("Remove to run test") @Test + @DisplayName("shouting gibberish") public void shoutingGibberish() { assertThat(bob.hey("FCECDFCAAB")) .isEqualTo("Whoa, chill out!"); @@ -35,6 +39,7 @@ public void shoutingGibberish() { @Disabled("Remove to run test") @Test + @DisplayName("asking a question") public void askingAQuestion() { assertThat(bob.hey("Does this cryogenic chamber make me look fat?")) .isEqualTo("Sure."); @@ -42,6 +47,7 @@ public void askingAQuestion() { @Disabled("Remove to run test") @Test + @DisplayName("asking a numeric question") public void askingANumericQuestion() { assertThat(bob.hey("You are, what, like 15?")) .isEqualTo("Sure."); @@ -49,6 +55,7 @@ public void askingANumericQuestion() { @Disabled("Remove to run test") @Test + @DisplayName("asking gibberish") public void askingGibberish() { assertThat(bob.hey("fffbbcbeab?")) .isEqualTo("Sure."); @@ -56,6 +63,7 @@ public void askingGibberish() { @Disabled("Remove to run test") @Test + @DisplayName("talking forcefully") public void talkingForcefully() { assertThat(bob.hey("Hi there!")) .isEqualTo("Whatever."); @@ -63,6 +71,7 @@ public void talkingForcefully() { @Disabled("Remove to run test") @Test + @DisplayName("using acronyms in regular speech") public void usingAcronymsInRegularSpeech() { assertThat(bob.hey("It's OK if you don't want to go work for NASA.")) .isEqualTo("Whatever."); @@ -70,6 +79,7 @@ public void usingAcronymsInRegularSpeech() { @Disabled("Remove to run test") @Test + @DisplayName("forceful question") public void forcefulQuestions() { assertThat(bob.hey("WHAT'S GOING ON?")) .isEqualTo("Calm down, I know what I'm doing!"); @@ -77,6 +87,7 @@ public void forcefulQuestions() { @Disabled("Remove to run test") @Test + @DisplayName("shouting numbers") public void shoutingNumbers() { assertThat(bob.hey("1, 2, 3 GO!")) .isEqualTo("Whoa, chill out!"); @@ -84,6 +95,7 @@ public void shoutingNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("no letters") public void onlyNumbers() { assertThat(bob.hey("1, 2, 3")) .isEqualTo("Whatever."); @@ -91,6 +103,7 @@ public void onlyNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("question with no letters") public void questionWithOnlyNumbers() { assertThat(bob.hey("4?")) .isEqualTo("Sure."); @@ -98,6 +111,7 @@ public void questionWithOnlyNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("shouting with special characters") public void shoutingWithSpecialCharacters() { assertThat(bob.hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!")) .isEqualTo("Whoa, chill out!"); @@ -105,6 +119,7 @@ public void shoutingWithSpecialCharacters() { @Disabled("Remove to run test") @Test + @DisplayName("shouting with no exclamation mark") public void shoutingWithNoExclamationMark() { assertThat(bob.hey("I HATE THE DENTIST")) .isEqualTo("Whoa, chill out!"); @@ -112,6 +127,7 @@ public void shoutingWithNoExclamationMark() { @Disabled("Remove to run test") @Test + @DisplayName("statement containing question mark") public void statementContainingQuestionMark() { assertThat(bob.hey("Ending with ? means a question.")) .isEqualTo("Whatever."); @@ -119,6 +135,7 @@ public void statementContainingQuestionMark() { @Disabled("Remove to run test") @Test + @DisplayName("non-letters with question") public void nonLettersWithQuestion() { assertThat(bob.hey(":) ?")) .isEqualTo("Sure."); @@ -126,6 +143,7 @@ public void nonLettersWithQuestion() { @Disabled("Remove to run test") @Test + @DisplayName("prattling on") public void prattlingOn() { assertThat(bob.hey("Wait! Hang on. Are you going to be OK?")) .isEqualTo("Sure."); @@ -133,6 +151,7 @@ public void prattlingOn() { @Disabled("Remove to run test") @Test + @DisplayName("silence") public void silence() { assertThat(bob.hey("")) .isEqualTo("Fine. Be that way!"); @@ -140,6 +159,7 @@ public void silence() { @Disabled("Remove to run test") @Test + @DisplayName("prolonged silence") public void prolongedSilence() { assertThat(bob.hey(" ")) .isEqualTo("Fine. Be that way!"); @@ -147,6 +167,7 @@ public void prolongedSilence() { @Disabled("Remove to run test") @Test + @DisplayName("alternate silence") public void alternateSilence() { assertThat(bob.hey("\t\t\t\t\t\t\t\t\t\t")) .isEqualTo("Fine. Be that way!"); @@ -154,6 +175,7 @@ public void alternateSilence() { @Disabled("Remove to run test") @Test + @DisplayName("starting with whitespace") public void startingWithWhitespace() { assertThat(bob.hey(" hmmmmmmm...")) .isEqualTo("Whatever."); @@ -161,6 +183,7 @@ public void startingWithWhitespace() { @Disabled("Remove to run test") @Test + @DisplayName("ending with whitespace") public void endingWithWhiteSpace() { assertThat(bob.hey("Okay if like my spacebar quite a bit? ")) .isEqualTo("Sure."); @@ -168,6 +191,7 @@ public void endingWithWhiteSpace() { @Disabled("Remove to run test") @Test + @DisplayName("other whitespace") public void otherWhiteSpace() { assertThat(bob.hey("\n\r \t")) .isEqualTo("Fine. Be that way!"); @@ -175,6 +199,7 @@ public void otherWhiteSpace() { @Disabled("Remove to run test") @Test + @DisplayName("non-question ending with whitespace") public void nonQuestionEndingWithWhiteSpace() { assertThat(bob.hey("This is a statement ending with whitespace ")) .isEqualTo("Whatever."); @@ -182,6 +207,7 @@ public void nonQuestionEndingWithWhiteSpace() { @Disabled("Remove to run test") @Test + @DisplayName("multiple line question") public void multipleLineQuestion() { assertThat(bob.hey("\nDoes this cryogenic chamber make\n me look fat?")) .isEqualTo("Sure."); diff --git a/exercises/practice/book-store/src/test/java/BookStoreTest.java b/exercises/practice/book-store/src/test/java/BookStoreTest.java index 920b83658..76fff41e4 100644 --- a/exercises/practice/book-store/src/test/java/BookStoreTest.java +++ b/exercises/practice/book-store/src/test/java/BookStoreTest.java @@ -1,6 +1,7 @@ import org.assertj.core.api.Assertions; 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.Arrays; @@ -23,6 +24,7 @@ public void setUp() { } @Test + @DisplayName("Only a single book") public void onlyASingleBook() { List books = Collections.singletonList(1); assertThat(bookStore.calculateBasketCost(books)) @@ -31,6 +33,7 @@ public void onlyASingleBook() { @Disabled("Remove to run test") @Test + @DisplayName("Two of the same book") public void twoOfSameBook() { List books = Arrays.asList(2, 2); assertThat(bookStore.calculateBasketCost(books)) @@ -39,6 +42,7 @@ public void twoOfSameBook() { @Disabled("Remove to run test") @Test + @DisplayName("Empty basket") public void emptyBasket() { List books = Collections.emptyList(); assertThat(bookStore.calculateBasketCost(books)) @@ -47,6 +51,7 @@ public void emptyBasket() { @Disabled("Remove to run test") @Test + @DisplayName("Two different books") public void twoDifferentBooks() { List books = Arrays.asList(1, 2); assertThat(bookStore.calculateBasketCost(books)) @@ -55,6 +60,7 @@ public void twoDifferentBooks() { @Disabled("Remove to run test") @Test + @DisplayName("Three different books") public void threeDifferentBooks() { List books = Arrays.asList(1, 2, 3); assertThat(bookStore.calculateBasketCost(books)) @@ -63,6 +69,7 @@ public void threeDifferentBooks() { @Disabled("Remove to run test") @Test + @DisplayName("Four different books") public void fourDifferentBooks() { List books = Arrays.asList(1, 2, 3, 4); assertThat(bookStore.calculateBasketCost(books)) @@ -71,6 +78,7 @@ public void fourDifferentBooks() { @Disabled("Remove to run test") @Test + @DisplayName("Five different books") public void fiveDifferentBooks() { List books = Arrays.asList(1, 2, 3, 4, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -79,6 +87,7 @@ public void fiveDifferentBooks() { @Disabled("Remove to run test") @Test + @DisplayName("Two groups of four is cheaper than group of five plus group of three") public void twoGroupsOfFourIsCheaperThanGroupOfFivePlusGroupOfThree() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -87,6 +96,7 @@ public void twoGroupsOfFourIsCheaperThanGroupOfFivePlusGroupOfThree() { @Disabled("Remove to run test") @Test + @DisplayName("Two groups of four is cheaper than groups of five and three") public void twoGroupsOfFourIsCheaperThanGroupsOfFiveAndThree() { List books = Arrays.asList(1, 1, 2, 3, 4, 4, 5, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -95,6 +105,7 @@ public void twoGroupsOfFourIsCheaperThanGroupsOfFiveAndThree() { @Disabled("Remove to run test") @Test + @DisplayName("Group of four plus group of two is cheaper than two groups of three") public void groupOfFourPlusGroupOfTwoIsCheaperThanTwoGroupsOfThree() { List books = Arrays.asList(1, 1, 2, 2, 3, 4); assertThat(bookStore.calculateBasketCost(books)) @@ -103,6 +114,7 @@ public void groupOfFourPlusGroupOfTwoIsCheaperThanTwoGroupsOfThree() { @Disabled("Remove to run test") @Test + @DisplayName("Two each of first four books and one copy each of rest") public void twoEachOfFirst4BooksAnd1CopyEachOfRest() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -111,6 +123,7 @@ public void twoEachOfFirst4BooksAnd1CopyEachOfRest() { @Disabled("Remove to run test") @Test + @DisplayName("Two copies of each book") public void twoCopiesOfEachBook() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -119,6 +132,7 @@ public void twoCopiesOfEachBook() { @Disabled("Remove to run test") @Test + @DisplayName("Three copies of first book and two each of remaining") public void threeCopiesOfFirstBookAnd2EachOfRemaining() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1); assertThat(bookStore.calculateBasketCost(books)) @@ -127,6 +141,7 @@ public void threeCopiesOfFirstBookAnd2EachOfRemaining() { @Disabled("Remove to run test") @Test + @DisplayName("Three each of first two books and two each of remaining books") public void threeEachOFirst2BooksAnd2EachOfRemainingBooks() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2); assertThat(bookStore.calculateBasketCost(books)) @@ -135,6 +150,7 @@ public void threeEachOFirst2BooksAnd2EachOfRemainingBooks() { @Disabled("Remove to run test") @Test + @DisplayName("Four groups of four are cheaper than two groups each of five and three") public void fourGroupsOfFourAreCheaperThanTwoGroupsEachOfFiveAndThree() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -143,6 +159,7 @@ public void fourGroupsOfFourAreCheaperThanTwoGroupsEachOfFiveAndThree() { @Disabled("Remove to run test") @Test + @DisplayName("Check that groups of four are created properly even when there are more groups of three than groups of five") public void groupsOfFourAreCreatedEvenWhenThereAreMoreGroupsOfThreeThanGroupsOfFive() { List books = Arrays.asList(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5); assertThat(bookStore.calculateBasketCost(books)) @@ -151,6 +168,7 @@ public void groupsOfFourAreCreatedEvenWhenThereAreMoreGroupsOfThreeThanGroupsOfF @Disabled("Remove to run test") @Test + @DisplayName("One group of one and four is cheaper than one group of two and three") public void oneGroupOfOneAndFourIsCheaperThanOneGroupOfTwoAndThree() { List books = Arrays.asList(1, 1, 2, 3, 4); assertThat(bookStore.calculateBasketCost(books)) @@ -159,6 +177,7 @@ public void oneGroupOfOneAndFourIsCheaperThanOneGroupOfTwoAndThree() { @Disabled("Remove to run test") @Test + @DisplayName("One group of one and two plus three groups of four is cheaper than one group of each size") public void oneGroupOfOneAndTwoPlusThreeGroupsOfFourIsCheaperThanOneGroupOfEachSize() { List books = Arrays.asList(1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5); assertThat(bookStore.calculateBasketCost(books)) From 92c45f8c8ed9fd541acc84b2a676d6739e1807a7 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Fri, 29 Aug 2025 19:13:54 +0530 Subject: [PATCH 4/7] Update exercises/practice/book-store/src/test/java/BookStoreTest.java Co-authored-by: Jagdish Prajapati --- exercises/practice/book-store/src/test/java/BookStoreTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/book-store/src/test/java/BookStoreTest.java b/exercises/practice/book-store/src/test/java/BookStoreTest.java index 76fff41e4..19d00c924 100644 --- a/exercises/practice/book-store/src/test/java/BookStoreTest.java +++ b/exercises/practice/book-store/src/test/java/BookStoreTest.java @@ -133,7 +133,7 @@ public void twoCopiesOfEachBook() { @Disabled("Remove to run test") @Test @DisplayName("Three copies of first book and two each of remaining") - public void threeCopiesOfFirstBookAnd2EachOfRemaining() { + public void threeCopiesOfFirstBookAndTwoEachOfRemaining() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1); assertThat(bookStore.calculateBasketCost(books)) .isCloseTo(68.00, Assertions.offset(EQUALITY_TOLERANCE)); From 7be261225ad3fd2b1529d59102bac9afacbb12a3 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Fri, 29 Aug 2025 19:14:45 +0530 Subject: [PATCH 5/7] Update exercises/practice/book-store/src/test/java/BookStoreTest.java Co-authored-by: Jagdish Prajapati --- exercises/practice/book-store/src/test/java/BookStoreTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/book-store/src/test/java/BookStoreTest.java b/exercises/practice/book-store/src/test/java/BookStoreTest.java index 19d00c924..ad942215f 100644 --- a/exercises/practice/book-store/src/test/java/BookStoreTest.java +++ b/exercises/practice/book-store/src/test/java/BookStoreTest.java @@ -142,7 +142,7 @@ public void threeCopiesOfFirstBookAndTwoEachOfRemaining() { @Disabled("Remove to run test") @Test @DisplayName("Three each of first two books and two each of remaining books") - public void threeEachOFirst2BooksAnd2EachOfRemainingBooks() { + public void threeEachOfFirstTwoBooksAndTwoEachOfRemainingBooks() { List books = Arrays.asList(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2); assertThat(bookStore.calculateBasketCost(books)) .isCloseTo(75.20, Assertions.offset(EQUALITY_TOLERANCE)); From 5d3bc34a52926f2c36aced8cb32872807ad83bc1 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Fri, 29 Aug 2025 19:21:21 +0530 Subject: [PATCH 6/7] binary-search --- .../practice/binary-search/src/test/java/BinarySearchTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/binary-search/src/test/java/BinarySearchTest.java b/exercises/practice/binary-search/src/test/java/BinarySearchTest.java index ccb411198..4846489c9 100644 --- a/exercises/practice/binary-search/src/test/java/BinarySearchTest.java +++ b/exercises/practice/binary-search/src/test/java/BinarySearchTest.java @@ -55,7 +55,7 @@ public void findsAValueAtTheEndOfAnArray() throws ValueNotFoundException { @Disabled("Remove to run test") @Test - @DisplayName("") + @DisplayName("finds a value in an array of odd length") public void findsAValueInAnArrayOfOddLength() throws ValueNotFoundException { List sortedListOfOddLength = List.of(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634); From 80e3c04d411c08bc042b310ca3a4b404faab0f57 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Fri, 29 Aug 2025 21:07:39 +0530 Subject: [PATCH 7/7] Update exercises/practice/book-store/src/test/java/BookStoreTest.java Co-authored-by: Jagdish Prajapati --- .../practice/book-store/src/test/java/BookStoreTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/practice/book-store/src/test/java/BookStoreTest.java b/exercises/practice/book-store/src/test/java/BookStoreTest.java index ad942215f..bbcbbcfb9 100644 --- a/exercises/practice/book-store/src/test/java/BookStoreTest.java +++ b/exercises/practice/book-store/src/test/java/BookStoreTest.java @@ -159,7 +159,9 @@ public void fourGroupsOfFourAreCheaperThanTwoGroupsEachOfFiveAndThree() { @Disabled("Remove to run test") @Test - @DisplayName("Check that groups of four are created properly even when there are more groups of three than groups of five") + @DisplayName( + "Check that groups of four are created properly even when there are more groups of three than groups of five" + ) public void groupsOfFourAreCreatedEvenWhenThereAreMoreGroupsOfThreeThanGroupsOfFive() { List books = Arrays.asList(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5); assertThat(bookStore.calculateBasketCost(books))