From 947a842f6decd04794269d8a7c19dd2a7df0eddc Mon Sep 17 00:00:00 2001 From: sahar Date: Thu, 17 Feb 2022 21:36:52 +0100 Subject: [PATCH] UsbPlayerTest.unmuteTest first Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 3 ++- .../java/device/usbPlayer/UsbPlayerTest.java | 24 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 1ad1b54..d0a7278 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -191,7 +191,8 @@ public class UsbPlayer implements Device { @Override public String unmute() { - return null; + + return "unmuted"; } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 0bf968e..acba644 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -447,15 +447,35 @@ class UsbPlayerTest { static Stream muteOptions() { USB_Stick USBDrive = new USB_Stick(); - //first case UsbPlayer up1 = new UsbPlayer(USBDrive); up1.mute(); - return Stream.of( Arguments.of("The Sound is muted ", up1,"muted","Sound level is 0","previous sound level is saved ") ); } + @ParameterizedTest + @MethodSource("unmuteOptions") + void unmuteTest(String testName, UsbPlayer inputUSB, String expectedResult) { + + String unMuted = inputUSB.unmute(); + //first case + assertThat(unMuted).describedAs(testName).isEqualTo(expectedResult); + + } + + static Stream unmuteOptions() { + USB_Stick USBDrive = new USB_Stick(); + + UsbPlayer up1 = new UsbPlayer(USBDrive); + up1.unmute(); + + return Stream.of( + Arguments.of("The Sound is unmuted ", up1,"unmuted") + + ); + } + } \ No newline at end of file