From a7c3ea8610529afc0f5548b0670346341180257a Mon Sep 17 00:00:00 2001 From: sahar Date: Thu, 17 Feb 2022 21:43:26 +0100 Subject: [PATCH] UsbPlayerTest.unmuteTest second Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 1 + src/test/java/device/usbPlayer/UsbPlayerTest.java | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index d0a7278..1ad4b8d 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -192,6 +192,7 @@ public class UsbPlayer implements Device { @Override public String unmute() { + setLautstaerke(soundWas); return "unmuted"; } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index acba644..7041eb1 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -458,22 +458,23 @@ class UsbPlayerTest { @ParameterizedTest @MethodSource("unmuteOptions") - void unmuteTest(String testName, UsbPlayer inputUSB, String expectedResult) { - + void unmuteTest(String testName, UsbPlayer inputUSB, String expectedResult,String testName2) { + int prevSound = inputUSB.getLautstaerke(); String unMuted = inputUSB.unmute(); //first case assertThat(unMuted).describedAs(testName).isEqualTo(expectedResult); + //Second case + assertThat(inputUSB.getLautstaerke()).describedAs(testName2).isEqualTo(prevSound); } 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") + Arguments.of("The Sound is unmuted ", up1,"unmuted","Sound level has changed") ); }