Commit 006271ad authored by Thomas DENIS's avatar Thomas DENIS
Browse files

Correction des test dans HandCreatureTest

parent 62263f09
package fr.univnantes.alma.server.game.item.player.hand; package fr.univnantes.alma.server.game.item.player.hand;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import fr.univnantes.alma.server.game.item.jeton.JetonSymbol;
import java.util.ArrayList;
import java.util.List;
class HandCreatureTest { class HandCreatureTest {
/*
HandCreature hand = new HandCreature(); HandCreature hand = new HandCreature();
@Test @Test
public void testInitializationJeton(){ public void testInitializationJeton(){
Jeton j1 = new JetonArtemia(); assertTrue(hand.getJetonSymbols().contains(JetonSymbol.ARTEMIA));
Jeton j2 = new JetonCreature(); assertTrue(hand.getJetonSymbols().contains(JetonSymbol.CREATURE));
Jeton j3 = new JetonCible(); assertTrue(hand.getJetonSymbols().contains(JetonSymbol.CIBLE));
hand.initializationJeton(); assertTrue(hand.getJetonSymbolsPlayed().isEmpty());
assertTrue(hand.getJetons().contains(j1));
assertTrue(hand.getJetons().contains(j2));
assertTrue(hand.getJetons().contains(j3));
} }
@Test @Test
public void testPlayJeton(){ public void testPlayJeton(){
Jeton j1 = new JetonArtemia(); JetonSymbol j1 = JetonSymbol.ARTEMIA;
hand.getJetons().add(j1); boolean result = hand.playJeton(j1);
Jeton result = hand.playJeton(j1); assertTrue(result);
assertFalse(hand.getJetons().contains(j1)); assertFalse(hand.getJetonSymbols().contains(j1));
assertTrue(hand.getJetonSymbolsPlayed().contains(j1));
} }
@Test @Test
public void testPlayJetonSet(){ public void testPlayJetonSet(){
Jeton j1 = new JetonArtemia(); JetonSymbol j1 = JetonSymbol.ARTEMIA;
Set<Jeton> testjetons = new HashSet<>(); List<JetonSymbol> testjetons = new ArrayList<>();
testjetons.add(j1); testjetons.add(j1);
hand.getJetons().add(j1); hand.getJetonSymbols().add(j1);
Set<Jeton> result = hand.playJeton(testjetons); boolean result = hand.playJeton(testjetons);
assertFalse(hand.getJetons().containsAll(testjetons)); assertTrue(result);
assertFalse(hand.getJetonSymbols().containsAll(testjetons));
assertTrue(hand.getJetonSymbolsPlayed().containsAll(testjetons));
} }
*/
} }
\ No newline at end of file
Supports Markdown
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