@Test(expected = NoCardInsertedException.class) public void testGetCardFromATMIfCardIsNotInserted() throws NotEnoughMoneyInATMException, NotEnoughMoneyInAccountException, NoCardInsertedException { System.out.println("getCardFromATMIfCardIsNotInserted"); ATM atmTest = new ATM(1000.0); atmTest.getCardFromATM(); }
@Test(expected = NoCardInsertedException.class) public void testGetCardFromATMMoreThanOneTime() throws NoCardInsertedException { System.out.println("getCardFromATMMoreThanOneTime"); ATM atmTest = new ATM(1000.0); Card mockCard = mock(Card.class); atmTest.insertCard(mockCard); atmTest.getCardFromATM(); atmTest.getCardFromATM(); }