@Test public void NoMWLNoRotation_IllegalCards_FailValidation(){ MostWantedList mwl = new MostWantedList(); DeckValidator validator = new DeckValidator(mwl); Card idCard = new CardBuilder("").withCode("idCard").Build(); Format format = new FormatBuilder().asCoreExperience().Build(); Deck deck = new Deck(idCard, format); String illegalSetCode = "illegal-notSC19"; Card illegalCard = new CardBuilder("").withSetCode(illegalSetCode).Build(); assertFalse(format.getPacks().contains(illegalSetCode)); deck.updateCardCount(illegalCard,2); assertEquals(1, deck.getCards().size()); boolean valid = validator.validate(deck, packs); assertFalse(valid); }
public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; }
DeckValidator { public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; } }
DeckValidator { public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; } DeckValidator(MostWantedList mwl); }
DeckValidator { public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; } DeckValidator(MostWantedList mwl); boolean validate(Deck deck, ArrayList<Pack> packs); }
DeckValidator { public boolean validate(Deck deck, ArrayList<Pack> packs) { boolean mwlValid = mMostWantedList == null || CheckMwl(deck); boolean cardPoolValid = CheckCardPool(deck, packs); return mwlValid && cardPoolValid; } DeckValidator(MostWantedList mwl); boolean validate(Deck deck, ArrayList<Pack> packs);  }