From cb6236b18036dfc7201bffc64210040adebed298 Mon Sep 17 00:00:00 2001 From: sahar Date: Fri, 11 Feb 2022 21:29:56 +0100 Subject: [PATCH] UsbPlayerTest.louder_10_Test() first Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 4 ++++ .../java/device/usbPlayer/UsbPlayerTest.java | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 0a6e75d..925e55b 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -104,6 +104,10 @@ public class UsbPlayer implements Device { } } + public void Louder_10(){ + Lautstaerke += 10; + } + @Override public int getVolume() { return 0; diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 70c0f7a..978c5db 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -114,7 +114,6 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { ); } - //////////////// @ParameterizedTest @MethodSource("PrevOptions") void PrevTest(String testName, UsbPlayer inputPlay, String expectedResult) { @@ -137,4 +136,20 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { ); } + @ParameterizedTest + @MethodSource("louder_10_Options") + void louder_10_Test(String testName, UsbPlayer inputPlay, int expectedResult) { + int volumeNum = inputPlay.getLautstaerke(); + assertThat(volumeNum).describedAs(testName).isEqualTo(expectedResult); + } + + static Stream louder_10_Options() { + UsbPlayer up1 = new UsbPlayer(); + up1.Louder_10(); + + return Stream.of( + Arguments.of("Volume was 0, should 10 ", up1, 10) + ); + } + } \ No newline at end of file