Browse Source

UsbPlayerTest.GoToLastTest first Case

feature.pr-USB-NewTest
sahar 3 years ago
parent
commit
27f942760b
  1. 4
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 16
      src/test/java/device/usbPlayer/UsbPlayerTest.java

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

@ -215,4 +215,8 @@ public class UsbPlayer implements Device {
//go to the first song in the list
setPlayTrack(getPlaylist().get(0));
}
public void GoToLast() {
setPlayTrack("Musik 03.mp3");
}
}

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

@ -336,5 +336,21 @@ class UsbPlayerTest {
);
}
@ParameterizedTest
@MethodSource("GoToLastOptions")
void GoToLastTest(String testName, UsbPlayer inputUSB, String expectedResult) {
String firstSong = inputUSB.getPlayTrack();
assertThat(firstSong ).describedAs(testName).isEqualTo(expectedResult);
}
static Stream<Arguments> GoToLastOptions() {
UsbPlayer up1 = new UsbPlayer();
up1.GoToLast();
return Stream.of(
Arguments.of("It should go to the first Song ", up1,"Musik 03.mp3")
);
}
}
Loading…
Cancel
Save