Add test for Battlebond

Test Battlebond's partner mechanic
This commit is contained in:
Chatziargyriou Eleftheria 2018-06-22 18:57:44 +03:00 committed by GitHub
parent d754410934
commit a1a7b1c59b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,10 +4,13 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import mage.abilities.Ability;
import mage.cards.Card;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardScanner;
import mage.sets.FateReforged;
import mage.sets.Battlebond;
import mage.abilities.keyword.PartnerWithAbility;
import mage.sets.MastersEditionII;
import mage.sets.MastersEditionIV;
import static org.junit.Assert.assertFalse;
@ -28,11 +31,33 @@ public class BoosterGenerationTest extends MageTestBase {
public void setUp() {
CardScanner.scan();
}
private static final List<String> basics = Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest");
@Test
public void testBattlebond(){
List<Card> booster = Battlebond.getInstance().createBooster();
boolean foundPartner = false;
String Partner = "";
for (Card card : booster){
for (Ability ability : card.getAbilities()){
if (ability instanceof PartnerWithAbility) {
if (foundPartner){
Assert.assertEquals(Partner, card.getName());
}
else{
foundPartner = true;
Partner = ((PartnerWithAbility) ability).getPartnerName();
}
}
}
}
}
@Test
public void testFateReforged() {
List<String> tapland = Arrays.asList(
"Bloodfell Caves", "Blossoming Sands", "Dismal Backwater", "Jungle Hollow", "Rugged Highlands",
"Scoured Barrens", "Swiftwater Cliffs", "Thornwood Falls", "Tranquil Cove", "Wind-Scarred Crag");
@ -44,7 +69,6 @@ public class BoosterGenerationTest extends MageTestBase {
|| contains(booster, basics, null));
// assertFalse(str(booster), contains(booster, basics, null));
}
@Test
public void testMastersEditionII() {
List<String> snowCoveredLand = Arrays.asList(