|
|
@ -1,6 +1,7 @@ |
|
|
|
import device.Device; |
|
|
|
import device.cdPlayer.CDPlayer; |
|
|
|
import device.radioPlayer.RadioPlayer; |
|
|
|
import device.usbPlayer.USB_Stick; |
|
|
|
import device.usbPlayer.UsbPlayer; |
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
@ -80,5 +81,31 @@ class BordComputerTest { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return count; |
|
|
|
}//changeDevice() |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("changeDeviceOptions") |
|
|
|
void changeDeviceTest(String testName, BordComputer inputBC, Device[] oldDevices ,int caseNr) { |
|
|
|
Device[] newDevicesList = inputBC.installedDevices.clone(); |
|
|
|
if (caseNr == 1) { |
|
|
|
assertThat(newDevicesList).describedAs(testName).isNotEqualTo(oldDevices); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> changeDeviceOptions() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { |
|
|
|
|
|
|
|
//first case |
|
|
|
BordComputer bc = new BordComputer(); |
|
|
|
bc.readConfig(); |
|
|
|
bc.setDevices(); |
|
|
|
Device[] currentDevices = new Device[bc.installedDevices.length]; |
|
|
|
currentDevices = bc.installedDevices.clone(); |
|
|
|
bc.changeDevice(); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("The order of the installedDevices should be changed ", bc,currentDevices,1) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |