|
|
@ -534,12 +534,19 @@ class CDPlayerTest { |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("muteTestData") |
|
|
|
void muteTest(String testName,String cases, CDPlayer _cdPlayer,String expectedResult) { |
|
|
|
assertThat(_cdPlayer.mute()).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
if(cases.equals("Case1")) { |
|
|
|
assertThat(_cdPlayer.mute()).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
if(cases.equals("Case2")) { |
|
|
|
_cdPlayer.mute(); |
|
|
|
assertThat(_cdPlayer.isMuted()).describedAs(testName).isEqualTo(true); |
|
|
|
} |
|
|
|
} |
|
|
|
static Stream<Arguments> muteTestData () { |
|
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("[mute() by checkingTheReturnValue ] => ShouldReturnAString", "Case1", cdPlayer1, "Volume muted.") |
|
|
|
Arguments.of("[mute() by checkingTheReturnValue ] => ShouldReturnAString", "Case1", cdPlayer1, "Volume muted."), |
|
|
|
Arguments.of("[mute() by checkingTheEffectAfterRun ] => VariableMutedShouldBeTrue", "Case2", cdPlayer1, "Volume muted.") |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|