Browse Source

BordComputer.play; instance of UsbPlayer -> without fulfilling preconditions: ShouldReturnAnException.

feature-pr-lastUpdate
JPANZO 3 years ago
parent
commit
097a133d26
  1. 8
      src/test/java/BordComputerTest.java

8
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<Arguments> 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")
);
}

Loading…
Cancel
Save