diff --git a/src/test/java/BordComputerTest.java b/src/test/java/BordComputerTest.java index 729d591..0242bcd 100644 --- a/src/test/java/BordComputerTest.java +++ b/src/test/java/BordComputerTest.java @@ -107,6 +107,11 @@ class BordComputerTest { assertEquals(NoItemEvenAllPreconditionAreMet.class, newException.getClass()); assertEquals(newException.getMessage(), "No Item returned even all preconditions are met."); } + if(testCase.equals("Case5")) { + Exception newException = assertThrows(NoItemEvenAllPreconditionAreMet.class, () -> bordComputer.play()); + assertEquals(NoItemEvenAllPreconditionAreMet.class, newException.getClass()); + assertEquals(newException.getMessage(), "No Item returned even all preconditions are met."); + } } static Stream playDate()throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { @@ -120,7 +125,8 @@ class BordComputerTest { Arguments.of("[CDPlayer-> play(): after all preconditions are met] => ShouldReturnAnItemToPlay","Case1",bordComputer,"CDPlayer"), Arguments.of("[RadioPlayer-> play(): after all preconditions are met] => ShouldReturnAnItemToPlay","Case2",bordComputer,"RadioPlayer"), Arguments.of("[UsbPlayer-> play(): after all preconditions are met] => ShouldReturnAnItemToPlay","Case3",bordComputer,"UsbPlayer"), - Arguments.of("[CDPlayer-> play(): without fulfilling preconditions] => ShouldReturnAnException","Case4",bordComputer2,"CDPlayer") + Arguments.of("[CDPlayer-> play(): without fulfilling preconditions] => ShouldReturnAnException","Case4",bordComputer2,"CDPlayer"), + Arguments.of("[UsbPlayer-> play(): without fulfilling preconditions] => ShouldReturnAnException","Case5",bordComputer2,"UsbPlayer") ); }