From 1912744e55bbf6b11225dab37ce80d88a1b31890 Mon Sep 17 00:00:00 2001 From: alpina0707 Date: Mon, 14 Feb 2022 19:46:23 +0100 Subject: [PATCH] changed from getLautstaerke() to getVolume() like it is defined in device interface --- src/main/java/device/radioPlayer/RadioPlayer.java | 6 +----- src/test/java/device/radioPlayer/RadioPlayerTest.java | 8 +------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index e32a3d7..1afb257 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -64,10 +64,6 @@ public class RadioPlayer implements Device { Lautstaerke = lautstaerke; } - public int getLautstaerke() { - return Lautstaerke; - } - public void changeRegion(String region){ switch (region) { case "BY": @@ -117,7 +113,7 @@ public class RadioPlayer implements Device { } @Override public int getVolume() { - return 0; + return Lautstaerke; } @Override diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 7829715..e7c0b3a 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -19,7 +19,7 @@ class RadioPlayerTest { @ParameterizedTest @MethodSource("quieterLouderOptions") void quieterLouderTest(String testName, RadioPlayer testRp, int expectedResult) { - int volume = testRp.getLautstaerke(); + int volume = testRp.getVolume(); assertThat(volume).describedAs(testName).isEqualTo(expectedResult); } @@ -67,12 +67,6 @@ class RadioPlayerTest { } -/* - @Test - void getVolume() { - } -*/ - @ParameterizedTest @MethodSource("prevNextOptions") void prevNextTest(String testName, RadioPlayer testRp, String expectedResult) {