Commit b802f96b authored by Thomas DENIS's avatar Thomas DENIS
Browse files

Ajout de test dans HandCreatureTest

parent 006271ad
package fr.univnantes.alma.server.game.item.player.hand;
import fr.univnantes.alma.server.game.item.Phase;
import fr.univnantes.alma.server.game.item.card.CardName;
import fr.univnantes.alma.server.game.item.card.TrackingCard;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
......@@ -21,6 +24,36 @@ class HandCreatureTest {
assertTrue(hand.getJetonSymbolsPlayed().isEmpty());
}
@Test
public void testAddTrackingCardToApplied(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCardToApplied(card);
assertTrue(hand.getTrackingCardToApplied().contains(card));
}
@Test
public void testAddTrackingCardToAppliedList(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
List<TrackingCard> testCards= new ArrayList<>();
testCards.add(card);
hand.addTrackingCardToApplied(testCards);
assertTrue(hand.getTrackingCardToApplied().containsAll(testCards));
}
@Test
public void testRemoveTrackingCardToApplied(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCardToApplied(card);
hand.removeTrackingCardToApplied(card);
assertFalse(hand.getTrackingCardToApplied().contains(card));
}
@Test
public void testRemoveTrackingCardToAppliedList(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
List<TrackingCard> testCards= new ArrayList<>();
testCards.add(card);
hand.addTrackingCardToApplied(testCards);
hand.removeTrackingCardToApplied(testCards);
assertFalse(hand.getTrackingCardToApplied().containsAll(testCards));
}
@Test
public void testPlayJeton(){
JetonSymbol j1 = JetonSymbol.ARTEMIA;
boolean result = hand.playJeton(j1);
......@@ -29,7 +62,7 @@ class HandCreatureTest {
assertTrue(hand.getJetonSymbolsPlayed().contains(j1));
}
@Test
public void testPlayJetonSet(){
public void testPlayJetonList(){
JetonSymbol j1 = JetonSymbol.ARTEMIA;
List<JetonSymbol> testjetons = new ArrayList<>();
testjetons.add(j1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment