From 41ac0cb9ceeebaa1843235e930323a834349e7a8 Mon Sep 17 00:00:00 2001 From: Atharv Patil Date: Mon, 22 Sep 2025 10:31:04 +0530 Subject: [PATCH] rna-transcription, robot-simulator, roman-numerals, rotational-cipher, run-length-encoding --- .../src/test/java/RnaTranscriptionTest.java | 7 +++++ .../src/test/java/RobotTest.java | 19 +++++++++++++ .../src/test/java/RomanNumeralsTest.java | 28 +++++++++++++++++++ .../src/test/java/RotationalCipherTest.java | 11 ++++++++ .../src/test/java/RunLengthEncodingTest.java | 14 ++++++++++ 5 files changed, 79 insertions(+) diff --git a/exercises/practice/rna-transcription/src/test/java/RnaTranscriptionTest.java b/exercises/practice/rna-transcription/src/test/java/RnaTranscriptionTest.java index 7de6deaf8..7b1cc753a 100644 --- a/exercises/practice/rna-transcription/src/test/java/RnaTranscriptionTest.java +++ b/exercises/practice/rna-transcription/src/test/java/RnaTranscriptionTest.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("Empty RNA sequence") public void testEmptyRnaSequence() { assertThat(rnaTranscription.transcribe("")).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("RNA complement of cytosine is guanine") public void testRnaTranscriptionOfCytosineIsGuanine() { assertThat(rnaTranscription.transcribe("C")).isEqualTo("G"); } @Disabled("Remove to run test") @Test + @DisplayName("RNA complement of guanine is cytosine") public void testRnaTranscriptionOfGuanineIsCytosine() { assertThat(rnaTranscription.transcribe("G")).isEqualTo("C"); } @Disabled("Remove to run test") @Test + @DisplayName("RNA complement of thymine is adenine") public void testRnaTranscriptionOfThymineIsAdenine() { assertThat(rnaTranscription.transcribe("T")).isEqualTo("A"); } @Disabled("Remove to run test") @Test + @DisplayName("RNA complement of adenine is uracil") public void testRnaTranscriptionOfAdenineIsUracil() { assertThat(rnaTranscription.transcribe("A")).isEqualTo("U"); } @Disabled("Remove to run test") @Test + @DisplayName("RNA complement") public void testRnaTranscription() { assertThat(rnaTranscription.transcribe("ACGTGGTCTTAA")).isEqualTo("UGCACCAGAAUU"); } diff --git a/exercises/practice/robot-simulator/src/test/java/RobotTest.java b/exercises/practice/robot-simulator/src/test/java/RobotTest.java index 27deb9ce4..5c8edbc0c 100644 --- a/exercises/practice/robot-simulator/src/test/java/RobotTest.java +++ b/exercises/practice/robot-simulator/src/test/java/RobotTest.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 RobotTest { /* Create robot */ @Test + @DisplayName("at origin facing north") public void atOriginFacingNorth() { Orientation initialOrientation = Orientation.NORTH; GridPosition initialGridPosition = new GridPosition(0, 0); @@ -19,6 +21,7 @@ public void atOriginFacingNorth() { @Disabled("Remove to run test") @Test + @DisplayName("at negative position facing south") public void atNegativePositionFacingSouth() { GridPosition initialGridPosition = new GridPosition(-1, -1); Orientation initialOrientation = Orientation.SOUTH; @@ -32,6 +35,7 @@ public void atNegativePositionFacingSouth() { @Disabled("Remove to run test") @Test + @DisplayName("changes north to east") public void changesNorthToEast() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.NORTH); @@ -45,6 +49,7 @@ public void changesNorthToEast() { @Disabled("Remove to run test") @Test + @DisplayName("changes east to south") public void changesEastToSouth() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.EAST); @@ -58,6 +63,7 @@ public void changesEastToSouth() { @Disabled("Remove to run test") @Test + @DisplayName("changes south to west") public void changesSouthToWest() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.SOUTH); @@ -71,6 +77,7 @@ public void changesSouthToWest() { @Disabled("Remove to run test") @Test + @DisplayName("changes west to north") public void changesWestToNorth() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.WEST); @@ -86,6 +93,7 @@ public void changesWestToNorth() { @Disabled("Remove to run test") @Test + @DisplayName("changes north to west") public void changesNorthToWest() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.NORTH); @@ -99,6 +107,7 @@ public void changesNorthToWest() { @Disabled("Remove to run test") @Test + @DisplayName("changes west to south") public void changesWestToSouth() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.WEST); @@ -112,6 +121,7 @@ public void changesWestToSouth() { @Disabled("Remove to run test") @Test + @DisplayName("changes south to east") public void changesSouthToEast() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.SOUTH); @@ -125,6 +135,7 @@ public void changesSouthToEast() { @Disabled("Remove to run test") @Test + @DisplayName("changes east to north") public void changesEastToNorth() { GridPosition initialGridPosition = new GridPosition(0, 0); Robot robot = new Robot(initialGridPosition, Orientation.EAST); @@ -140,6 +151,7 @@ public void changesEastToNorth() { @Disabled("Remove to run test") @Test + @DisplayName("facing north increments Y") public void facingNorthIncrementsY() { Orientation initialOrientation = Orientation.NORTH; Robot robot = new Robot(new GridPosition(0, 0), initialOrientation); @@ -153,6 +165,7 @@ public void facingNorthIncrementsY() { @Disabled("Remove to run test") @Test + @DisplayName("facing south decrements Y") public void facingSouthDecrementsY() { Orientation initialOrientation = Orientation.SOUTH; Robot robot = new Robot(new GridPosition(0, 0), initialOrientation); @@ -166,6 +179,7 @@ public void facingSouthDecrementsY() { @Disabled("Remove to run test") @Test + @DisplayName("facing east increments X") public void facingEastIncrementsX() { Orientation initialOrientation = Orientation.EAST; Robot robot = new Robot(new GridPosition(0, 0), initialOrientation); @@ -179,6 +193,7 @@ public void facingEastIncrementsX() { @Disabled("Remove to run test") @Test + @DisplayName("facing west decrements X") public void facingWestDecrementsX() { Orientation initialOrientation = Orientation.WEST; Robot robot = new Robot(new GridPosition(0, 0), initialOrientation); @@ -194,6 +209,7 @@ public void facingWestDecrementsX() { @Disabled("Remove to run test") @Test + @DisplayName("moving east and north from README") public void movingEastAndNorthFromReadme() { Robot robot = new Robot(new GridPosition(7, 3), Orientation.NORTH); @@ -209,6 +225,7 @@ public void movingEastAndNorthFromReadme() { @Disabled("Remove to run test") @Test + @DisplayName("moving west and north") public void movingWestAndNorth() { Robot robot = new Robot(new GridPosition(0, 0), Orientation.NORTH); @@ -223,6 +240,7 @@ public void movingWestAndNorth() { @Disabled("Remove to run test") @Test + @DisplayName("moving west and south") public void movingWestAndSouth() { Robot robot = new Robot(new GridPosition(2, -7), Orientation.EAST); @@ -237,6 +255,7 @@ public void movingWestAndSouth() { @Disabled("Remove to run test") @Test + @DisplayName("moving east and north") public void movingEastAndNorth() { Robot robot = new Robot(new GridPosition(8, 4), Orientation.SOUTH); diff --git a/exercises/practice/roman-numerals/src/test/java/RomanNumeralsTest.java b/exercises/practice/roman-numerals/src/test/java/RomanNumeralsTest.java index 5d02ddc6f..8b7c21da8 100644 --- a/exercises/practice/roman-numerals/src/test/java/RomanNumeralsTest.java +++ b/exercises/practice/roman-numerals/src/test/java/RomanNumeralsTest.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 RomanNumeralsTest { private RomanNumerals romanNumerals; @Test + @DisplayName("1 is I") public void test1ToRomanNumberI() { romanNumerals = new RomanNumerals(1); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("I"); @@ -15,6 +17,7 @@ public void test1ToRomanNumberI() { @Disabled("Remove to run test") @Test + @DisplayName("2 is II") public void test2ToRomanNumberII() { romanNumerals = new RomanNumerals(2); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("II"); @@ -22,6 +25,7 @@ public void test2ToRomanNumberII() { @Disabled("Remove to run test") @Test + @DisplayName("3 is III") public void test3ToRomanNumberIII() { romanNumerals = new RomanNumerals(3); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("III"); @@ -29,6 +33,7 @@ public void test3ToRomanNumberIII() { @Disabled("Remove to run test") @Test + @DisplayName("4 is IV") public void test4ToRomanNumberIV() { romanNumerals = new RomanNumerals(4); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("IV"); @@ -36,6 +41,7 @@ public void test4ToRomanNumberIV() { @Disabled("Remove to run test") @Test + @DisplayName("5 is V") public void test5ToRomanNumberV() { romanNumerals = new RomanNumerals(5); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("V"); @@ -43,6 +49,7 @@ public void test5ToRomanNumberV() { @Disabled("Remove to run test") @Test + @DisplayName("6 is VI") public void test6ToRomanNumberVI() { romanNumerals = new RomanNumerals(6); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("VI"); @@ -50,6 +57,7 @@ public void test6ToRomanNumberVI() { @Disabled("Remove to run test") @Test + @DisplayName("9 is IX") public void test9ToRomanNumberIX() { romanNumerals = new RomanNumerals(9); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("IX"); @@ -57,6 +65,7 @@ public void test9ToRomanNumberIX() { @Disabled("Remove to run test") @Test + @DisplayName("16 is XVI") public void test16ToRomanNumberXVI() { romanNumerals = new RomanNumerals(16); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("XVI"); @@ -64,6 +73,7 @@ public void test16ToRomanNumberXVI() { @Disabled("Remove to run test") @Test + @DisplayName("27 is XXVII") public void test27ToRomanNumberXXVII() { romanNumerals = new RomanNumerals(27); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("XXVII"); @@ -71,6 +81,7 @@ public void test27ToRomanNumberXXVII() { @Disabled("Remove to run test") @Test + @DisplayName("48 is XLVIII") public void test48ToRomanNumberXLVIII() { romanNumerals = new RomanNumerals(48); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("XLVIII"); @@ -78,6 +89,7 @@ public void test48ToRomanNumberXLVIII() { @Disabled("Remove to run test") @Test + @DisplayName("49 is XLIX") public void test49ToRomanNumberXLIX() { romanNumerals = new RomanNumerals(49); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("XLIX"); @@ -85,6 +97,7 @@ public void test49ToRomanNumberXLIX() { @Disabled("Remove to run test") @Test + @DisplayName("59 is LIX") public void test59ToRomanNumberLIX() { romanNumerals = new RomanNumerals(59); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("LIX"); @@ -92,6 +105,7 @@ public void test59ToRomanNumberLIX() { @Disabled("Remove to run test") @Test + @DisplayName("66 is LXVI") public void test66ToRomanNumberLXVI() { romanNumerals = new RomanNumerals(66); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("LXVI"); @@ -99,6 +113,7 @@ public void test66ToRomanNumberLXVI() { @Disabled("Remove to run test") @Test + @DisplayName("93 is XCIII") public void test93ToRomanNumberXCIII() { romanNumerals = new RomanNumerals(93); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("XCIII"); @@ -106,6 +121,7 @@ public void test93ToRomanNumberXCIII() { @Disabled("Remove to run test") @Test + @DisplayName("141 is CXLI") public void test141ToRomanNumberCXLI() { romanNumerals = new RomanNumerals(141); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("CXLI"); @@ -113,6 +129,7 @@ public void test141ToRomanNumberCXLI() { @Disabled("Remove to run test") @Test + @DisplayName("163 is CLXIII") public void test163ToRomanNumberCLXIII() { romanNumerals = new RomanNumerals(163); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("CLXIII"); @@ -120,6 +137,7 @@ public void test163ToRomanNumberCLXIII() { @Disabled("Remove to run test") @Test + @DisplayName("166 is CLXVI") public void test166ToRomanNumberCLXVI() { romanNumerals = new RomanNumerals(166); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("CLXVI"); @@ -127,6 +145,7 @@ public void test166ToRomanNumberCLXVI() { @Disabled("Remove to run test") @Test + @DisplayName("402 is CDII") public void test402ToRomanNumberCDII() { romanNumerals = new RomanNumerals(402); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("CDII"); @@ -134,6 +153,7 @@ public void test402ToRomanNumberCDII() { @Disabled("Remove to run test") @Test + @DisplayName("575 is DLXXV") public void test575ToRomanNumberDLXXV() { romanNumerals = new RomanNumerals(575); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("DLXXV"); @@ -141,6 +161,7 @@ public void test575ToRomanNumberDLXXV() { @Disabled("Remove to run test") @Test + @DisplayName("666 is DCLXVI") public void test666ToRomanNumberDCLXVI() { romanNumerals = new RomanNumerals(666); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("DCLXVI"); @@ -148,6 +169,7 @@ public void test666ToRomanNumberDCLXVI() { @Disabled("Remove to run test") @Test + @DisplayName("911 is CMXI") public void test911ToRomanNumberCMXI() { romanNumerals = new RomanNumerals(911); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("CMXI"); @@ -155,6 +177,7 @@ public void test911ToRomanNumberCMXI() { @Disabled("Remove to run test") @Test + @DisplayName("1024 is MXXIV") public void test1024ToRomanNumberMXXIV() { romanNumerals = new RomanNumerals(1024); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MXXIV"); @@ -162,6 +185,7 @@ public void test1024ToRomanNumberMXXIV() { @Disabled("Remove to run test") @Test + @DisplayName("1666 is MDCLXVI") public void test1666ToRomanNumberMDCLXVI() { romanNumerals = new RomanNumerals(1666); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MDCLXVI"); @@ -169,6 +193,7 @@ public void test1666ToRomanNumberMDCLXVI() { @Disabled("Remove to run test") @Test + @DisplayName("3000 is MMM") public void test3000ToRomanNumberMMM() { romanNumerals = new RomanNumerals(3000); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MMM"); @@ -176,6 +201,7 @@ public void test3000ToRomanNumberMMM() { @Disabled("Remove to run test") @Test + @DisplayName("3001 is MMMI") public void test3001ToRomanNumberMMMI() { romanNumerals = new RomanNumerals(3001); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MMMI"); @@ -183,6 +209,7 @@ public void test3001ToRomanNumberMMMI() { @Disabled("Remove to run test") @Test + @DisplayName("3888 is MMMDCCCLXXXVIII") public void test3888ToRomanNumberMMMDCCCLXXXVIII() { romanNumerals = new RomanNumerals(3888); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MMMDCCCLXXXVIII"); @@ -190,6 +217,7 @@ public void test3888ToRomanNumberMMMDCCCLXXXVIII() { @Disabled("Remove to run test") @Test + @DisplayName("3999 is MMMCMXCIX") public void test3999ToRomanNumberMMMCMXCIX() { romanNumerals = new RomanNumerals(3999); assertThat(romanNumerals.getRomanNumeral()).isEqualTo("MMMCMXCIX"); diff --git a/exercises/practice/rotational-cipher/src/test/java/RotationalCipherTest.java b/exercises/practice/rotational-cipher/src/test/java/RotationalCipherTest.java index cd18aa56e..be75833ab 100644 --- a/exercises/practice/rotational-cipher/src/test/java/RotationalCipherTest.java +++ b/exercises/practice/rotational-cipher/src/test/java/RotationalCipherTest.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 RotationalCipherTest { private RotationalCipher rotationalCipher; @Test + @DisplayName("rotate a by 0, same output as input") public void rotateSingleCharacterBy0() { rotationalCipher = new RotationalCipher(0); assertThat(rotationalCipher.rotate("a")).isEqualTo("a"); @@ -15,6 +17,7 @@ public void rotateSingleCharacterBy0() { @Disabled("Remove to run test") @Test + @DisplayName("rotate a by 1") public void rotateSingleCharacterBy1() { rotationalCipher = new RotationalCipher(1); assertThat(rotationalCipher.rotate("a")).isEqualTo("b"); @@ -22,6 +25,7 @@ public void rotateSingleCharacterBy1() { @Disabled("Remove to run test") @Test + @DisplayName("rotate a by 26, same output as input") public void rotateSingleCharacterBy26() { rotationalCipher = new RotationalCipher(26); assertThat(rotationalCipher.rotate("a")).isEqualTo("a"); @@ -29,6 +33,7 @@ public void rotateSingleCharacterBy26() { @Disabled("Remove to run test") @Test + @DisplayName("rotate m by 13") public void rotateSingleCharacterBy13() { rotationalCipher = new RotationalCipher(13); assertThat(rotationalCipher.rotate("m")).isEqualTo("z"); @@ -36,6 +41,7 @@ public void rotateSingleCharacterBy13() { @Disabled("Remove to run test") @Test + @DisplayName("rotate n by 13 with wrap around alphabet") public void rotateSingleCharacterWithWrapAround() { rotationalCipher = new RotationalCipher(13); assertThat(rotationalCipher.rotate("n")).isEqualTo("a"); @@ -43,6 +49,7 @@ public void rotateSingleCharacterWithWrapAround() { @Disabled("Remove to run test") @Test + @DisplayName("rotate capital letters") public void rotateCapitalLetters() { rotationalCipher = new RotationalCipher(5); assertThat(rotationalCipher.rotate("OMG")).isEqualTo("TRL"); @@ -50,6 +57,7 @@ public void rotateCapitalLetters() { @Disabled("Remove to run test") @Test + @DisplayName("rotate spaces") public void rotateSpaces() { rotationalCipher = new RotationalCipher(5); assertThat(rotationalCipher.rotate("O M G")).isEqualTo("T R L"); @@ -57,6 +65,7 @@ public void rotateSpaces() { @Disabled("Remove to run test") @Test + @DisplayName("rotate numbers") public void rotateNumbers() { rotationalCipher = new RotationalCipher(4); assertThat(rotationalCipher.rotate("Testing 1 2 3 testing")).isEqualTo("Xiwxmrk 1 2 3 xiwxmrk"); @@ -64,6 +73,7 @@ public void rotateNumbers() { @Disabled("Remove to run test") @Test + @DisplayName("rotate punctuation") public void rotatePunctuation() { rotationalCipher = new RotationalCipher(21); assertThat(rotationalCipher.rotate("Let's eat, Grandma!")).isEqualTo("Gzo'n zvo, Bmviyhv!"); @@ -71,6 +81,7 @@ public void rotatePunctuation() { @Disabled("Remove to run test") @Test + @DisplayName("rotate all letters") public void rotateAllLetters() { rotationalCipher = new RotationalCipher(13); assertThat(rotationalCipher.rotate("Gur dhvpx oebja sbk whzcf bire gur ynml qbt.")) diff --git a/exercises/practice/run-length-encoding/src/test/java/RunLengthEncodingTest.java b/exercises/practice/run-length-encoding/src/test/java/RunLengthEncodingTest.java index 6923ccdbd..47373f2e2 100644 --- a/exercises/practice/run-length-encoding/src/test/java/RunLengthEncodingTest.java +++ b/exercises/practice/run-length-encoding/src/test/java/RunLengthEncodingTest.java @@ -1,5 +1,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -13,24 +14,28 @@ public void setUp() { } @Test + @DisplayName("empty string") public void encodeEmpty() { assertThat(runLengthEncoding.encode("")).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("single characters only are encoded without count") public void encodeWithOnlySingleValues() { assertThat(runLengthEncoding.encode("XYZ")).isEqualTo("XYZ"); } @Disabled("Remove to run test") @Test + @DisplayName("string with no single characters") public void encodeWithNoSingleValues() { assertThat(runLengthEncoding.encode("AABBBCCCC")).isEqualTo("2A3B4C"); } @Disabled("Remove to run test") @Test + @DisplayName("single characters mixed with repeated characters") public void encodeWithMixedValues() { assertThat(runLengthEncoding.encode( "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")) @@ -39,6 +44,7 @@ public void encodeWithMixedValues() { @Disabled("Remove to run test") @Test + @DisplayName("multiple whitespace mixed in string") public void encodeWithWhitespaceValues() { assertThat(runLengthEncoding.encode(" hsqq qww ")) .isEqualTo("2 hs2q q2w2 "); @@ -46,30 +52,35 @@ public void encodeWithWhitespaceValues() { @Disabled("Remove to run test") @Test + @DisplayName("lowercase characters") public void encodeWithLowercaseValues() { assertThat(runLengthEncoding.encode("aabbbcccc")).isEqualTo("2a3b4c"); } @Disabled("Remove to run test") @Test + @DisplayName("empty string") public void decodeEmpty() { assertThat(runLengthEncoding.decode("")).isEmpty(); } @Disabled("Remove to run test") @Test + @DisplayName("single characters only") public void decodeWithOnlySingleValues() { assertThat(runLengthEncoding.decode("XYZ")).isEqualTo("XYZ"); } @Disabled("Remove to run test") @Test + @DisplayName("string with no single characters") public void decodeWithNoSingleValues() { assertThat(runLengthEncoding.decode("2A3B4C")).isEqualTo("AABBBCCCC"); } @Disabled("Remove to run test") @Test + @DisplayName("single characters with repeated characters") public void decodeWithMixedValues() { assertThat(runLengthEncoding.decode("12WB12W3B24WB")) .isEqualTo("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"); @@ -77,18 +88,21 @@ public void decodeWithMixedValues() { @Disabled("Remove to run test") @Test + @DisplayName("multiple whitespace mixed in string") public void decodeWithWhitespaceValues() { assertThat(runLengthEncoding.decode("2 hs2q q2w2 ")).isEqualTo(" hsqq qww "); } @Disabled("Remove to run test") @Test + @DisplayName("lowercase string") public void decodeWithLowercaseValues() { assertThat(runLengthEncoding.decode("2a3b4c")).isEqualTo("aabbbcccc"); } @Disabled("Remove to run test") @Test + @DisplayName("encode followed by decode gives original string") public void encodeThenDecode() { String inOut = "zzz ZZ zZ"; String encoded = runLengthEncoding.encode(inOut);