/* * Remove the selected card in JTable from the Deck * Update the table model * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(ActionEvent e) { if (deckView.getRow() > -1) { Card selectedCard = deck.getCards().get(deckView.getRow()); deck.removeFromDeck(selectedCard); tableModel = new TableModel(deck); } }
@Test public void deckTest() { Deck d = new Deck(); NewCard c = d.giveCard(0); assertEquals(c.getRank(), "2"); }