From 0ba1d23c8ce5e925ee7b7904d328eb6fa1c53d1f Mon Sep 17 00:00:00 2001 From: sahar Date: Fri, 18 Feb 2022 19:41:18 +0100 Subject: [PATCH] BordComputerTest.changeDeviceTest second case --- src/main/java/BordComputer.java | 1 + src/test/java/BordComputerTest.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/BordComputer.java b/src/main/java/BordComputer.java index c8b597a..38d24d1 100644 --- a/src/main/java/BordComputer.java +++ b/src/main/java/BordComputer.java @@ -45,6 +45,7 @@ public class BordComputer { installedDevices = tempDevices; //setting activeDevice activeDevice = installedDevices[0]; + return null; } } diff --git a/src/test/java/BordComputerTest.java b/src/test/java/BordComputerTest.java index 1118e4a..056b5f3 100644 --- a/src/test/java/BordComputerTest.java +++ b/src/test/java/BordComputerTest.java @@ -89,6 +89,9 @@ class BordComputerTest { Device[] newDevicesList = inputBC.installedDevices.clone(); if (caseNr == 1 ) { assertThat(newDevicesList).describedAs(testName).isNotEqualTo(oldDevices); + }else if (caseNr == 2) { + Device currentDevice = inputBC.activeDevice; + assertThat(currentDevice).describedAs(testName).isNotEqualTo(prvDevice); } } @@ -102,10 +105,18 @@ class BordComputerTest { currentDevices = bc.installedDevices.clone(); String m = bc.changeDevice(); + //second case + BordComputer bc1 = new BordComputer(); + bc1.readConfig(); + bc1.setDevices(); + Device prvDevice = bc1.activeDevice; + m =bc1.changeDevice(); + return Stream.of( - Arguments.of("The order of the installedDevices should be changed ", bc,currentDevices,null,"",1) + Arguments.of("The order of the installedDevices should be changed ", bc,currentDevices,null,"",1), + Arguments.of("The active Device should be changed ", bc1,null,prvDevice,"",2) ); } } \ No newline at end of file