mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
Tests: added name test for +2 mace;
This commit is contained in:
parent
9698e3488f
commit
24847c1fa7
1 changed files with 26 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
package org.mage.test.cards.single.afr;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.util.GameLog;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class Plus2MaceTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_NameProcessingByRegExp() {
|
||||
// + character can't processing by regexp, so it must be quoted replaced in code by Pattern.quote(mageObject.getName())
|
||||
String cardName = "+2 Mace";
|
||||
CardInfo cardinfo = CardRepository.instance.findCard(cardName);
|
||||
Assert.assertNotNull(cardName + " must exists", cardinfo);
|
||||
Card card = cardinfo.getCard();
|
||||
String cardText = GameLog.replaceNameByColoredName(card, card.getSpellAbility().toString(), null);
|
||||
Assert.assertTrue("card text must contain card name", cardText.contains(cardName));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue