From 5b1c8e910161737a42e9707d8972c896eecba71c Mon Sep 17 00:00:00 2001 From: JPANZO Date: Thu, 17 Feb 2022 22:23:18 +0100 Subject: [PATCH] Method mute of CDPlayer tested on checkingTheReturnValue -> ShouldReturnAString. --- src/main/java/device/cdPlayer/CDPlayer.java | 2 +- src/test/java/device/cdPlayer/CDPlayerTest.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 09e52fa..7ee9b81 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -120,7 +120,7 @@ public class CDPlayer implements Device { @Override public String unmute() { - return null; + return ("Volume unmute."); } @Override diff --git a/src/test/java/device/cdPlayer/CDPlayerTest.java b/src/test/java/device/cdPlayer/CDPlayerTest.java index 5975e17..31353b1 100644 --- a/src/test/java/device/cdPlayer/CDPlayerTest.java +++ b/src/test/java/device/cdPlayer/CDPlayerTest.java @@ -565,7 +565,17 @@ class CDPlayerTest { ); } - + @ParameterizedTest + @MethodSource("unmuteTestData") + void unmuteTest(String testName,String cases, CDPlayer _cdPlayer,String expectedResult) { + assertThat(_cdPlayer.unmute()).describedAs(testName).isEqualTo(expectedResult); + } + static Stream unmuteTestData () { + CDPlayer cdPlayer1 = new CDPlayer(); + return Stream.of( + Arguments.of("[unmute() by checkingTheReturnValue ] => ShouldReturnAString", "Case1", cdPlayer1, "Volume unmute.") + ); + } } \ No newline at end of file