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

Version 2 de HandTraqueTest

parent d0d6a772
......@@ -95,6 +95,115 @@ class HandTraqueTest {
public void testPlaceCardPlayedIsEmpty(){
assertTrue(hand.placeCardPlayedIsEmpty());
}
@Test
public void testThrowAwayPlaceCard(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.setPlaceCards(testCards);
hand.playPlaceCard(testCards);
assertTrue(hand.throwAwayPlaceCard());
assertTrue(hand.getDefausse().containsAll(testCards));
assertTrue(hand.getPlaceCardsPlayed().isEmpty());
}
@Test
public void testThrowAwayPlaceCardGiven(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.setPlaceCards(testCards);
assertTrue(hand.throwAwayPlaceCard(card));
assertFalse(hand.getPlaceCards().contains(card));
assertTrue(hand.getDefausse().contains(card));
}
@Test
public void testThrowAwayPlaceCardList(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.setPlaceCards(testCards);
assertTrue(hand.throwAwayPlaceCard(testCards));
assertTrue(hand.getDefausse().containsAll(testCards));
}
@Test
public void testTakeBackPlaceCard(){
//TODO
}
@Test
public void testTakeBackPlaceCardGiven(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.setPlaceCards(testCards);
hand.throwAwayPlaceCard(card);
assertTrue(hand.takeBackPlaceCard(card));
assertTrue(hand.getPlaceCards().contains(card));
assertFalse(hand.getDefausse().contains(card));
}
@Test
public void testTakeBackPlaceCardList(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.setPlaceCards(testCards);
hand.throwAwayPlaceCard(testCards);
assertTrue(hand.takeBackPlaceCard(testCards));
assertTrue(hand.getPlaceCards().containsAll(testCards));
}
@Test
public void testTakeBackPlayedPlaceCards(){
//TODO
}
@Test
public void testTakeBackAllPlaceCardFromDefausse(){
//TODO
}
@Test
public void testAddPlaceCard(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
assertTrue(hand.addPlaceCard(card));
assertTrue(hand.getPlaceCards().contains(card));
}
@Test
public void testAddPlaceCardList(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
assertTrue(hand.addPlaceCard(testCards));
assertTrue(hand.getPlaceCards().containsAll(testCards));
}
@Test
public void testAddPlaceCardInDefausse(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
assertTrue(hand.addPlaceCardInDefausse(card));
assertTrue(hand.getDefausse().contains(card));
}
@Test
public void testAddPlaceCardListInDefausse(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
assertTrue(hand.addPlaceCardInDefausse(testCards));
assertTrue(hand.getDefausse().containsAll(testCards));
}
@Test
public void testPlayPlaceCard(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
hand.addPlaceCard(card);
assertTrue(hand.playPlaceCard(card));
assertTrue(hand.getPlaceCardsPlayed().contains(card));
assertFalse(hand.getPlaceCards().contains(card));
}
@Test
public void testPlayPlaceCardList(){
PlaceCard card = new PlaceCard(CardName.ANTRE,"antre","antre",1,"url","bleu");
List<PlaceCard> testCards = new ArrayList<>();
testCards.add(card);
hand.addPlaceCard(testCards);
assertTrue(hand.playPlaceCard(testCards));
assertTrue(hand.getPlaceCardsPlayed().containsAll(testCards));
assertFalse(hand.getPlaceCards().containsAll(testCards));
}
/* SurvivalCards Methods */
......
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