From 41f0fecd6ef6b2e79d15b77de944888b57cb55cc Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 11 Dec 2011 16:37:34 +0400 Subject: [PATCH] Test for AI that reproduces the case when useful "may" ability isn't used. --- .../org/mage/test/ai/NimShamblerTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/ai/NimShamblerTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/ai/NimShamblerTest.java b/Mage.Tests/src/test/java/org/mage/test/ai/NimShamblerTest.java new file mode 100644 index 0000000000..a735f0e3f7 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/ai/NimShamblerTest.java @@ -0,0 +1,32 @@ +package org.mage.test.ai; + +import junit.framework.Assert; +import mage.Constants; +import mage.game.permanent.Permanent; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestBase; + +/** + * @author ayratn + */ +public class NimShamblerTest extends CardTestBase { + + /** + * Reproduces the bug when AI sacrifices its creatures for no reason. + */ + @Test + public void testNoCreatureWasSacrificed() { + addCard(Constants.Zone.BATTLEFIELD, playerA, "Nim Shambler"); + addCard(Constants.Zone.BATTLEFIELD, playerA, "Blood Cultist"); + addCard(Constants.Zone.BATTLEFIELD, playerB, "Ob Nixilis, the Fallen"); + + execute(); + + Permanent nimShambler = getPermanent("Nim Shambler", playerA.getId()); + Assert.assertNotNull(nimShambler); + + Permanent bloodCultist = getPermanent("Blood Cultist", playerA.getId()); + Assert.assertNotNull(bloodCultist); + + } +}