|
|
@ -81,4 +81,31 @@ class BordComputerTest { |
|
|
|
} |
|
|
|
return count; |
|
|
|
} |
|
|
|
|
|
|
|
//// |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("changeDeviceOptions") |
|
|
|
void changeDeviceTest(String testName, BordComputer inputBC, Device[] oldDevices,Device prvDevice,String message ,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(); |
|
|
|
String m = bc.changeDevice(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("The order of the installedDevices should be changed ", bc,currentDevices,null,"",1) |
|
|
|
); |
|
|
|
} |
|
|
|
} |