diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 304d03d..e1da09f 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -109,7 +109,7 @@ public class CDPlayer implements Device { @Override public String mute() { - return null; + return ("Volume muted."); } @Override diff --git a/src/test/java/device/cdPlayer/CDPlayerTest.java b/src/test/java/device/cdPlayer/CDPlayerTest.java index c3cda36..354719a 100644 --- a/src/test/java/device/cdPlayer/CDPlayerTest.java +++ b/src/test/java/device/cdPlayer/CDPlayerTest.java @@ -493,7 +493,7 @@ class CDPlayerTest { @ParameterizedTest @MethodSource("addToFavoriteSongsData") - void addToFavoriteSongs(String testName,String cases, CDPlayer _cdPlayer,Exception exception) { + void addToFavoriteSongsTest(String testName,String cases, CDPlayer _cdPlayer,Exception exception) { if(cases.equals("Case1")) { String myFavoriteSong = _cdPlayer.getCD().getPlayList()[0]; _cdPlayer.addToFavoriteSongs(myFavoriteSong); @@ -531,4 +531,19 @@ class CDPlayerTest { ); } + @ParameterizedTest + @MethodSource("muteTestData") + void muteTest(String testName,String cases, CDPlayer _cdPlayer,String expectedResult) { + assertThat(_cdPlayer.mute()).describedAs(testName).isEqualTo(expectedResult); + } + static Stream muteTestData () { + CDPlayer cdPlayer1 = new CDPlayer(); + return Stream.of( + Arguments.of("[mute() by checkingTheReturnValue ] => ShouldReturnAString", "Case1", cdPlayer1, "Volume muted.") + ); + } + + + + } \ No newline at end of file