在测试用例中,如果我试图调用方法(例如 placeOnTop()),它应该测试卡片来自哪个牌组。我不确定这个构造函数是如何标记的/或者是否完全创建不同类型的套牌......
public class StandardDeck implements Deck {
List<Card> cards = new ArrayList<>();
public StandardDeck() {
for (Suit suit : Suit.values()) {
for (int rank = 1; rank <= 13; rank++) {
Card e = new StandardCard(suit, rank, this);
cards.add(e);
}
}
}
public void placeOnTop(Card c) {
cards.add(0, c);
}
public Card takeTop() {
return cards.remove(0);
}
}