import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.ArrayList; import static org.junit.jupiter.api.Assertions.assertTrue; public class StackTest { private Cards newCards, cards, nochNewCards; private Card newCard, card; private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; private Stack stack; @BeforeEach void setUp() { card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); cardsArrayList = new ArrayList(); cardsArrayList2 = new ArrayList(); cardsArrayList3 = new ArrayList(); cardsArrayList.add(card); cardsArrayList2.add(newCard); cardsArrayList2.add(card); cards = new Cards(cardsArrayList); newCards = new Cards(cardsArrayList2); nochNewCards = new Cards(cardsArrayList3); stack = new Stack(cards, nochNewCards); } @Test void test_addDeck() { stack.addDeck(newCards); Cards result = stack.getDeck(); assertTrue(result.equals(newCards)); } @Test void test_delDeck() { stack.addDeck(newCards); stack.delDeck(newCard); assertTrue(stack.getDeck().equals(cards)); } @Test void test_getDeck() { Cards result = stack.getDeck(); assertTrue(result.equals(cards)); } }