Browse Source

UsbPlayerTest.GoToFirstTest first Case

feature.pr-USB-NewTest
sahar 3 years ago
parent
commit
280b8843f2
  1. 3
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 17
      src/test/java/device/usbPlayer/UsbPlayerTest.java

3
src/main/java/device/usbPlayer/UsbPlayer.java

@ -211,4 +211,7 @@ public class UsbPlayer implements Device {
return false;
}
public void GoToFirst() {
setPlayTrack("Musik 01.mp3");
}
}

17
src/test/java/device/usbPlayer/UsbPlayerTest.java

@ -309,5 +309,22 @@ class UsbPlayerTest {
);
}
//GoToFirst()
@ParameterizedTest
@MethodSource("GoToFirstOptions")
void GoToFirstTest(String testName, UsbPlayer inputUSB, String expectedResult) {
String firstSong = inputUSB.getPlayTrack();
assertThat(firstSong ).describedAs(testName).isEqualTo(expectedResult);
}
static Stream<Arguments> GoToFirstOptions() {
UsbPlayer up1 = new UsbPlayer();
up1.GoToFirst();
return Stream.of(
Arguments.of("It should go to the first Song ", up1,up1.getPlaylist().get(0))
);
}
}
Loading…
Cancel
Save