|
|
@ -1,6 +1,12 @@ |
|
|
|
package device.usbPlayer; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
|
import org.junit.jupiter.params.provider.MethodSource; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
@ -47,9 +53,23 @@ class UsbPlayerTest { |
|
|
|
@Test |
|
|
|
void chooseOption() { |
|
|
|
} |
|
|
|
*/ |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("louderOptions") |
|
|
|
void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { |
|
|
|
int volumeNum = inputPlay.getLautstaerke(); |
|
|
|
assertThat(volumeNum).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void play() { |
|
|
|
static Stream<Arguments> louderOptions() { |
|
|
|
UsbPlayer up1 = new UsbPlayer(); |
|
|
|
up1.louder(); |
|
|
|
UsbPlayer up2 = new UsbPlayer(); |
|
|
|
up2.setLautstaerke(100); |
|
|
|
up2.louder(); |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Volume is : 1 ", up1, 1), |
|
|
|
Arguments.of("Volume is : 100 ", up2, 100) |
|
|
|
); |
|
|
|
} |
|
|
|
*/ |
|
|
|
} |