Browse Source

Method getVolume of CDPlayer tested on getVolumeReturnValueBetween0And100.

feature-pr-RadioPlayer-getItemList
JPANZO 3 years ago
parent
commit
0e4bbd07dd
  1. 15
      src/test/java/device/cdPlayer/CDPlayerTest.java

15
src/test/java/device/cdPlayer/CDPlayerTest.java

@ -2,6 +2,7 @@ package device.cdPlayer;
import device.Device;
import device.cdPlayer.exceptions.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
@ -249,10 +250,7 @@ class CDPlayerTest {
for (int i = 0; i < interfaceMethods.length; i++) {
assertThat(deviceMethods.contains(interfaceMethods[i].getName())).describedAs(testName).isEqualTo(true);
}
}
}
static Stream<Arguments> getOptionsTestData () {
CDPlayer cdPlayer1 = new CDPlayer();
@ -263,6 +261,15 @@ class CDPlayerTest {
);
}
@Test
void getVolumeReturnValueBetween0And100(){
CDPlayer cdPlayer1 = new CDPlayer();
boolean volumeIstInValueRange=false;
int volume=cdPlayer1.getVolume();
if(volume>=0 && volume <=100){
volumeIstInValueRange=true;
}
assertThat(volumeIstInValueRange).isEqualTo(true);
}
}
Loading…
Cancel
Save