|
@ -2,6 +2,7 @@ package device.cdPlayer; |
|
|
|
|
|
|
|
|
import device.Device; |
|
|
import device.Device; |
|
|
import device.cdPlayer.exceptions.*; |
|
|
import device.cdPlayer.exceptions.*; |
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.extension.ExtendWith; |
|
|
import org.junit.jupiter.api.extension.ExtendWith; |
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
@ -249,10 +250,7 @@ class CDPlayerTest { |
|
|
for (int i = 0; i < interfaceMethods.length; i++) { |
|
|
for (int i = 0; i < interfaceMethods.length; i++) { |
|
|
assertThat(deviceMethods.contains(interfaceMethods[i].getName())).describedAs(testName).isEqualTo(true); |
|
|
assertThat(deviceMethods.contains(interfaceMethods[i].getName())).describedAs(testName).isEqualTo(true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
static Stream<Arguments> getOptionsTestData () { |
|
|
static Stream<Arguments> getOptionsTestData () { |
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |