From 6ede79aa1ffb4c8182e6c073499c2a90280f5e2c Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 15 May 2021 20:34:08 +0400 Subject: [PATCH] Tests: added additional test for modern format validation (related to 8d0efaabc96aed637f3d9905f1adb9bcc734c86b) --- .../serverside/deck/DeckValidatorTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java index abefb81884..04c5c043a5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/DeckValidatorTest.java @@ -229,6 +229,30 @@ public class DeckValidatorTest extends MageTestBase { assertCounterspellValid(deckList); } + private void assertPsychatogValid(ArrayList deckList) { + // if that card will be valid in modern then you must replace it with another non valid card + // google for "Cards Wizards Should Reprint for Modern" + final boolean needValid = false; + boolean valid = testDeckValid(new Modern(), deckList); + if (valid != needValid) { + Assert.fail("Psychatog " + (needValid ? "must be" : "not") + " allowed in modern"); + } + } + + @Test + public void testModernPsychatog() { + // test non valid card + ArrayList deckList = new ArrayList<>(); + deckList.add(new CardNameAmount("ODY", 292, 4)); + deckList.add(new CardNameAmount("Mountain", 56)); + assertPsychatogValid(deckList); + + deckList.clear(); + deckList.add(new CardNameAmount("VMA", 258, 4)); + deckList.add(new CardNameAmount("Mountain", 56)); + assertPsychatogValid(deckList); + } + @Test public void testModernBanned() { ArrayList deckList = new ArrayList<>();