mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[ZNR] updated booster generation and added test
This commit is contained in:
parent
18c8a8539e
commit
21ef775700
2 changed files with 44 additions and 2 deletions
|
@ -1,9 +1,13 @@
|
|||
package mage.sets;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.ModalDoubleFacesCard;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SetType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
@ -21,11 +25,10 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
this.hasBasicLands = true;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 9;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.numBoosterDoubleFaced = 1;
|
||||
this.maxCardNumberInBooster = 280;
|
||||
|
||||
cards.add(new SetCardInfo("Acquisitions Expert", 89, Rarity.UNCOMMON, mage.cards.a.AcquisitionsExpert.class));
|
||||
|
@ -420,4 +423,10 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Zof Consumption", 132, Rarity.UNCOMMON, mage.cards.z.ZofConsumption.class));
|
||||
cards.add(new SetCardInfo("Zulaport Duelist", 88, Rarity.COMMON, mage.cards.z.ZulaportDuelist.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean boosterIsValid(List<Card> booster) {
|
||||
return super.boosterIsValid(booster)
|
||||
&& booster.stream().filter(ModalDoubleFacesCard.class::isInstance).count() == 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -297,6 +297,39 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZendikarRising_MDFC() {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
List<Card> booster = ZendikarRising.getInstance().createBooster();
|
||||
|
||||
assertEquals("Booster does not have 15 cards", 15, booster.size());
|
||||
assertTrue(
|
||||
"Booster contains cards from another set",
|
||||
booster.stream().map(Card::getExpansionSetCode).allMatch("ZNR"::equals)
|
||||
);
|
||||
assertEquals(
|
||||
"Booster must contain exactly 1 basic land", 1,
|
||||
booster.stream().filter(MageObject::isBasic).count()
|
||||
);
|
||||
assertEquals(
|
||||
"Booster must contain exactly 1 rare or mythic", 1,
|
||||
booster.stream().map(Card::getRarity).filter(rarity -> rarity == Rarity.RARE || rarity == Rarity.MYTHIC).count()
|
||||
);
|
||||
assertEquals(
|
||||
"Booster must contain exactly 3 uncommons", 3,
|
||||
booster.stream().map(Card::getRarity).filter(Rarity.UNCOMMON::equals).count()
|
||||
);
|
||||
assertEquals(
|
||||
"Booster must contain exactly 10 uncommons", 10,
|
||||
booster.stream().map(Card::getRarity).filter(Rarity.COMMON::equals).count()
|
||||
);
|
||||
assertEquals(
|
||||
"Booster must contain exactly 1 MDFC", 1,
|
||||
booster.stream().filter(ModalDoubleFacesCard.class::isInstance).count()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKaldheim_SnowLandAndMDFC() {
|
||||
boolean foundVale = false;
|
||||
|
|
Loading…
Reference in a new issue