Commit 2c6ac810 authored by Thomas DENIS's avatar Thomas DENIS
Browse files

AJout de nouveaux test dans HandCreatureTest

parent b802f96b
......@@ -6,9 +6,11 @@ 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;
import static org.junit.jupiter.api.Assertions.assertEquals;
import fr.univnantes.alma.server.game.item.jeton.JetonSymbol;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -54,6 +56,18 @@ class HandCreatureTest {
assertFalse(hand.getTrackingCardToApplied().containsAll(testCards));
}
@Test
public void testGetTrackingCardToApplied(){
assertEquals(hand.getTrackingCardToApplied(),new ArrayList<>());
}
@Test
public void testGetJetonSymbolsPlayed(){
assertEquals(hand.getJetonSymbolsPlayed(),new ArrayList<>());
}
@Test
public void testGetJetonSymbols(){
assertEquals(hand.getJetonSymbols(),new ArrayList<>(Arrays.asList(JetonSymbol.CIBLE, JetonSymbol.CREATURE, JetonSymbol.ARTEMIA)));
}
@Test
public void testPlayJeton(){
JetonSymbol j1 = JetonSymbol.ARTEMIA;
boolean result = hand.playJeton(j1);
......@@ -72,5 +86,97 @@ class HandCreatureTest {
assertFalse(hand.getJetonSymbols().containsAll(testjetons));
assertTrue(hand.getJetonSymbolsPlayed().containsAll(testjetons));
}
@Test
public void testJetonSize(){
assertEquals(3,hand.jetonsSize());
}
@Test
public void testJetonsPlayedSize(){
assertEquals(0,hand.jetonsPlayedSize());
}
@Test
public void testJetonsIsEmpty(){
assertFalse(hand.jetonsIsEmpty());
}
@Test
public void testJetonsPlayedIsEmpty(){
assertTrue(hand.jetonsPlayedIsEmpty());
}
@Test
public void testGetMaxTrackingCards(){
assertEquals(3,hand.getMaxTrackingCards());
}
@Test
public void testTrackingCardHandSize(){
assertEquals(0,hand.trackingCardHandSize());
}
@Test
public void testTrackingCardPlayedSize(){
assertEquals(0,hand.trackingCardPlayedSize());
}
@Test
public void testTrackingCardHandIsEmpty(){
assertTrue(hand.trackingCardIsEmpty());
}
@Test
public void testTrackingCardHandPlayedIsEmpty(){
assertTrue(hand.trackingCardPlayedIsEmpty());
}
@Test
public void testClearTrackingCardPlayed(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCard(card);
hand.playTrackingCard(card);
hand.clearTrackingCardPlayed();
assertTrue(hand.trackingCardPlayedIsEmpty());
}
@Test
public void testAddTrackingCard(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCard(card);
assertTrue(hand.getTrackingCardHand().contains(card));
}
@Test
public void testAddTrackingCardList(){
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.addTrackingCard(testCards);
assertTrue(hand.getTrackingCardHand().containsAll(testCards));
}
@Test
public void testRemoveTrackingCard(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCard(card);
hand.removeTrackingCard(card);
assertFalse(hand.getTrackingCardHand().contains(card));
}
@Test
public void testRemoveTrackingCardList(){
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.addTrackingCard(testCards);
hand.removeTrackingCard(testCards);
assertFalse(hand.getTrackingCardHand().containsAll(testCards));
}
@Test
public void testPlayTrackingCard(){
TrackingCard card = new TrackingCard(CardName.INTERFERENCES,"InterferenceCard","The powers of the Beach and the Wreck are ineffective", Phase.PHASE_2);
hand.addTrackingCard(card);
assertTrue(hand.playTrackingCard(card));
assertFalse(hand.getTrackingCardHand().contains(card));
assertTrue(hand.getTrackingCardsPlayed().contains(card));
}
@Test
public void testPlayTrackingCardList(){
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.addTrackingCard(testCards);
assertTrue(hand.playTrackingCard(testCards));
assertFalse(hand.getTrackingCardHand().containsAll(testCards));
assertTrue(hand.getTrackingCardsPlayed().containsAll(testCards));
}
}
\ No newline at end of file
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