Added tests for the new Ottar errata and the original Decipher Ottar

This commit is contained in:
Christian 'ketura' McCarty
2022-08-15 15:41:49 -05:00
parent c427d35030
commit 6437896cd8
3 changed files with 295 additions and 27 deletions

View File

@@ -57,7 +57,6 @@
}
}
}
]
gametext: When you play Ulaire Nertea, for each companion over 4, you may play a unique [Wraith] minion from your discard pile.
lore: Some accepted Sauron's gift for glory and a notion of great deeds.
promotext: ""

View File

@@ -0,0 +1,222 @@
package com.gempukku.lotro.cards.official.set01;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test;
import java.util.Arrays;
import java.util.HashMap;
import static org.junit.Assert.*;
public class Card_01_080_Tests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("ottar", "1_80");
put("gandalf", "1_72");
put("chaff1", "1_80");
put("chaff2", "1_80");
put("chaff3", "1_80");
put("chaff4", "1_80");
put("chaff5", "1_80");
put("chaff6", "1_80");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
);
}
@Test
public void OttarStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 1
* Title: *Ottar, Man of Laketown
* Side: Free Peoples
* Culture: Gandalf
* Twilight Cost: 1
* Type: Ally
* Subtype: Man
* Strength: 2
* Vitality: 2
* Site Number: 3
* Game Text: To play, spot Gandalf.
* <b>Fellowship:</b> Exert Ottar and discard a card from hand to draw a card.
*/
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
assertTrue(ottar.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, ottar.getBlueprint().getSide());
assertEquals(Culture.GANDALF, ottar.getBlueprint().getCulture());
assertEquals(CardType.ALLY, ottar.getBlueprint().getCardType());
assertEquals(Race.MAN, ottar.getBlueprint().getRace());
assertEquals(1, ottar.getBlueprint().getTwilightCost());
assertEquals(2, ottar.getBlueprint().getStrength());
assertEquals(2, ottar.getBlueprint().getVitality());
//assertEquals(, ottar.getBlueprint().getResistance());
//assertEquals(Signet., ottar.getBlueprint().getSignet());
assertEquals(3, ottar.getBlueprint().getAllyHomeSiteNumbers()[0]); // Change this to getAllyHomeSiteNumbers for allies
}
@Test
public void OttarRequiresGandalfToPlay() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
scn.FreepsMoveCardToHand(ottar, gandalf);
scn.StartGame();
assertFalse(scn.FreepsCardPlayAvailable(ottar));
scn.FreepsPlayCard(gandalf);
assertTrue(scn.FreepsCardPlayAvailable(ottar));
}
@Test
public void OttarExertsAndDiscardsOneCardFromHandToDrawOne() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
PhysicalCardImpl chaff3 = scn.GetFreepsCard("chaff3");
PhysicalCardImpl chaff4 = scn.GetFreepsCard("chaff4");
PhysicalCardImpl chaff5 = scn.GetFreepsCard("chaff5");
PhysicalCardImpl chaff6 = scn.GetFreepsCard("chaff6");
scn.FreepsMoveCardToHand(chaff1, chaff2, chaff3);
scn.FreepsMoveCharToTable(ottar);
scn.FreepsMoveCardsToTopOfDeck(chaff4, chaff5, chaff6);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(3, scn.GetFreepsHandCount());
assertTrue(scn.FreepsCardActionAvailable(ottar));
scn.FreepsUseCardAction(ottar);
assertTrue(scn.FreepsDecisionAvailable("Choose cards from hand to discard"));
assertEquals("0", scn.FreepsGetADParam("min")[0]);
assertEquals("3", scn.FreepsGetADParam("max")[0]);
assertEquals(Zone.HAND, chaff1.getZone());
assertEquals(3, scn.GetFreepsHandCount());
scn.FreepsChooseCard(chaff1);
assertEquals(1, scn.GetWoundsOn(ottar));
assertEquals(Zone.DISCARD, chaff1.getZone());
assertEquals(3, scn.GetFreepsHandCount()); // Discarded 1, drew 1
}
@Test
public void OttarExertsAndDiscardsTwoCardsFromHandToDrawTwo() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
PhysicalCardImpl chaff3 = scn.GetFreepsCard("chaff3");
PhysicalCardImpl chaff4 = scn.GetFreepsCard("chaff4");
PhysicalCardImpl chaff5 = scn.GetFreepsCard("chaff5");
PhysicalCardImpl chaff6 = scn.GetFreepsCard("chaff6");
scn.FreepsMoveCardToHand(chaff1, chaff2, chaff3);
scn.FreepsMoveCharToTable(ottar);
scn.FreepsMoveCardsToTopOfDeck(chaff4, chaff5, chaff6);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(3, scn.GetFreepsHandCount());
assertTrue(scn.FreepsCardActionAvailable(ottar));
scn.FreepsUseCardAction(ottar);
assertTrue(scn.FreepsDecisionAvailable("Choose cards from hand to discard"));
assertEquals("0", scn.FreepsGetADParam("min")[0]);
assertEquals("3", scn.FreepsGetADParam("max")[0]);
assertEquals(Zone.HAND, chaff1.getZone());
assertEquals(Zone.HAND, chaff2.getZone());
assertEquals(3, scn.GetFreepsHandCount());
scn.FreepsChooseCards(chaff1, chaff2);
assertEquals(1, scn.GetWoundsOn(ottar));
assertEquals(Zone.DISCARD, chaff1.getZone());
assertEquals(Zone.DISCARD, chaff2.getZone());
assertEquals(3, scn.GetFreepsHandCount()); // Discarded 2, drew 2
}
@Test
public void OttarExertsAndDiscardsThreeCardsFromHandToDrawThree() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
PhysicalCardImpl chaff3 = scn.GetFreepsCard("chaff3");
PhysicalCardImpl chaff4 = scn.GetFreepsCard("chaff4");
PhysicalCardImpl chaff5 = scn.GetFreepsCard("chaff5");
PhysicalCardImpl chaff6 = scn.GetFreepsCard("chaff6");
scn.FreepsMoveCardToHand(chaff1, chaff2, chaff3);
scn.FreepsMoveCharToTable(ottar);
scn.FreepsMoveCardsToTopOfDeck(chaff4, chaff5, chaff6);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(3, scn.GetFreepsHandCount());
assertTrue(scn.FreepsCardActionAvailable(ottar));
scn.FreepsUseCardAction(ottar);
assertTrue(scn.FreepsDecisionAvailable("Choose cards from hand to discard"));
assertEquals("0", scn.FreepsGetADParam("min")[0]);
assertEquals("3", scn.FreepsGetADParam("max")[0]);
assertEquals(Zone.HAND, chaff1.getZone());
assertEquals(Zone.HAND, chaff2.getZone());
assertEquals(Zone.HAND, chaff3.getZone());
assertEquals(3, scn.GetFreepsHandCount());
scn.FreepsChooseCards(chaff1, chaff2, chaff3);
assertEquals(1, scn.GetWoundsOn(ottar));
assertEquals(Zone.DISCARD, chaff1.getZone());
assertEquals(Zone.DISCARD, chaff2.getZone());
assertEquals(Zone.DISCARD, chaff3.getZone());
assertEquals(3, scn.GetFreepsHandCount()); // Discarded 3, drew 3
}
@Test
public void OttarDoesNotRequireCardInHandToDraw() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
scn.FreepsMoveCharToTable(ottar);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(0, scn.GetFreepsHandCount());
assertTrue(scn.FreepsCardActionAvailable(ottar));
}
}

View File

@@ -8,6 +8,7 @@ import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
import org.junit.Test;
import java.util.Arrays;
import java.util.HashMap;
import static org.junit.Assert.assertEquals;
@@ -21,8 +22,11 @@ public class Card_01_080_ErrataTests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "71_80");
// put other cards in here as needed for the test case
put("ottar", "71_80");
put("gandalf", "1_72");
put("chaff1", "71_80");
put("chaff2", "71_80");
put("chaff3", "71_80");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -30,9 +34,7 @@ public class Card_01_080_ErrataTests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void OttarStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -41,10 +43,10 @@ public class Card_01_080_ErrataTests
* Side: Free Peoples
* Culture: Gandalf
* Twilight Cost: 1
* Type: ally
* Type: Ally
* Subtype: Man
* Strength: 2
* Vitality: 2
* Vitality: 4
* Site Number: 3
* Game Text: To play, spot Gandalf.
* <b>Fellowship:</b> Exert Ottar and discard a card from hand to draw a card.
@@ -53,34 +55,79 @@ public class Card_01_080_ErrataTests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GANDALF, card.getBlueprint().getCulture());
assertEquals(CardType.ALLY, card.getBlueprint().getCardType());
assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA));
assertEquals(1, card.getBlueprint().getTwilightCost());
assertEquals(2, card.getBlueprint().getStrength());
assertEquals(2, card.getBlueprint().getVitality());
//assertEquals(, card.getBlueprint().getResistance());
//assertEquals(Signet., card.getBlueprint().getSignet());
assertEquals(3, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
assertTrue(ottar.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, ottar.getBlueprint().getSide());
assertEquals(Culture.GANDALF, ottar.getBlueprint().getCulture());
assertEquals(CardType.ALLY, ottar.getBlueprint().getCardType());
assertEquals(Race.MAN, ottar.getBlueprint().getRace());
assertEquals(1, ottar.getBlueprint().getTwilightCost());
assertEquals(2, ottar.getBlueprint().getStrength());
assertEquals(4, ottar.getBlueprint().getVitality());
//assertEquals(, ottar.getBlueprint().getResistance());
//assertEquals(Signet., ottar.getBlueprint().getSignet());
assertEquals(3, Arrays.stream(ottar.getBlueprint().getAllyHomeSiteNumbers()).findFirst().getAsInt()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void OttarTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void OttarRequiresGandalfToPlay() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
scn.FreepsMoveCardToHand(ottar, gandalf);
scn.StartGame();
scn.FreepsPlayCard(card);
assertFalse(scn.FreepsCardPlayAvailable(ottar));
scn.FreepsPlayCard(gandalf);
assertTrue(scn.FreepsCardPlayAvailable(ottar));
}
assertEquals(1, scn.GetTwilight());
@Test
public void OttarExertsAndDiscardsACardFromHandToDraw() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
scn.FreepsMoveCardToHand(chaff1);
scn.FreepsMoveCharToTable(ottar);
scn.FreepsMoveCardsToTopOfDeck(chaff2);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(Zone.HAND, chaff1.getZone());
assertEquals(Zone.DECK, chaff2.getZone());
assertEquals(1, scn.GetFreepsHandCount());
assertTrue(scn.FreepsCardActionAvailable(ottar));
scn.FreepsUseCardAction(ottar);
assertEquals(1, scn.GetWoundsOn(ottar));
assertEquals(Zone.DISCARD, chaff1.getZone());
assertEquals(Zone.HAND, chaff2.getZone());
assertEquals(1, scn.GetFreepsHandCount()); // Discarded 1, drew 1
}
@Test
public void OttarRequiresCardInHandToDraw() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl ottar = scn.GetFreepsCard("ottar");
PhysicalCardImpl chaff1 = scn.GetFreepsCard("chaff1");
PhysicalCardImpl chaff2 = scn.GetFreepsCard("chaff2");
scn.FreepsMoveCharToTable(ottar);
scn.StartGame();
assertEquals(0, scn.GetWoundsOn(ottar));
assertEquals(0, scn.GetFreepsHandCount());
assertFalse(scn.FreepsCardActionAvailable(ottar));
}
}