Browse Source

UsbPlayerTest.findSongTest first Case

feature-pr-USB-10Louder
sahar 3 years ago
parent
commit
692a519b76
  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

@ -183,4 +183,8 @@ public class UsbPlayer implements Device {
}
public int findSong(String song){
return -1;
}
}

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

@ -190,4 +190,20 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) {
);
}
@ParameterizedTest
@MethodSource("FindSongOptions")
void findSongTest(String testName, UsbPlayer inputPlay, int expectedResult) {
int songLocation = inputPlay.findSong("song 4");
assertThat(songLocation).describedAs(testName).isEqualTo(expectedResult);
}
static Stream<Arguments> FindSongOptions() {
UsbPlayer up1 = new UsbPlayer();
return Stream.of(
Arguments.of("The song is not in the Album", up1, -1)
);
}
}
Loading…
Cancel
Save