2020-04-19 11:55:59 +02:00
|
|
|
package condition;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertFalse;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
import main.Joueur;
|
2020-04-23 11:00:11 +02:00
|
|
|
import personnage.Allie;
|
|
|
|
import personnage.CartePersonnage;
|
|
|
|
import personnage.Vampire;
|
2020-04-19 11:55:59 +02:00
|
|
|
|
|
|
|
class ConditionTypeTest {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
2020-04-20 13:48:13 +02:00
|
|
|
public void isTrue_RenvoieAppartenanceEquipe() {
|
2020-04-19 11:55:59 +02:00
|
|
|
|
|
|
|
|
2020-04-23 11:00:11 +02:00
|
|
|
List<CartePersonnage.Equipe> equipes = new ArrayList<CartePersonnage.Equipe>();
|
|
|
|
equipes.add(CartePersonnage.Equipe.HUNTER);
|
|
|
|
equipes.add(CartePersonnage.Equipe.NEUTRE);
|
2020-05-06 12:04:30 +02:00
|
|
|
ConditionEquipe ct = new ConditionEquipe(equipes);
|
2020-04-19 11:55:59 +02:00
|
|
|
|
|
|
|
Joueur j = new Joueur(null);
|
2020-04-23 11:00:11 +02:00
|
|
|
|
|
|
|
j.setCartePersonnage(new Allie(j));
|
|
|
|
|
2020-04-19 11:55:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
assertTrue(ct.isTrue(j));
|
|
|
|
|
2020-04-23 11:00:11 +02:00
|
|
|
j.setCartePersonnage(new Vampire(j));
|
|
|
|
|
2020-04-19 11:55:59 +02:00
|
|
|
assertFalse(ct.isTrue(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-20 13:48:13 +02:00
|
|
|
public void isTrue_ListTypeVide_False() {
|
2020-04-19 11:55:59 +02:00
|
|
|
|
|
|
|
|
2020-04-23 11:00:11 +02:00
|
|
|
List<CartePersonnage.Equipe> equipes = new ArrayList<CartePersonnage.Equipe>();
|
2020-04-19 11:55:59 +02:00
|
|
|
|
2020-05-06 12:04:30 +02:00
|
|
|
ConditionEquipe ct = new ConditionEquipe(equipes);
|
2020-04-19 11:55:59 +02:00
|
|
|
Joueur j = new Joueur(null);
|
2020-04-23 11:00:11 +02:00
|
|
|
j.setCartePersonnage(new Allie(j));
|
2020-04-19 11:55:59 +02:00
|
|
|
assertFalse(ct.isTrue(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|