Adding tests for Mount Doom and LR#3
This commit is contained in:
@@ -1043,10 +1043,10 @@ public class GenericCardTestHelper extends AbstractAtTest {
|
||||
public void FreepsResolveSkirmish(String name) throws DecisionResultInvalidException { FreepsResolveSkirmish(GetFreepsCard(name)); }
|
||||
public void FreepsResolveSkirmish(PhysicalCardImpl comp) throws DecisionResultInvalidException { FreepsChooseCard(comp); }
|
||||
|
||||
public void FreepsChooseCard(String name) throws DecisionResultInvalidException { FreepsChooseCard(GetFreepsCard(name)); }
|
||||
public void FreepsChooseCard(PhysicalCardImpl card) throws DecisionResultInvalidException { playerDecided(P1, String.valueOf(card.getCardId())); }
|
||||
public void ShadowChooseCard(String name) throws DecisionResultInvalidException { ShadowChooseCard(GetShadowCard(name)); }
|
||||
public void ShadowChooseCard(PhysicalCardImpl card) throws DecisionResultInvalidException { playerDecided(P2, String.valueOf(card.getCardId())); }
|
||||
public void FreepsChooseCard(String name) throws DecisionResultInvalidException { FreepsChooseCards(GetFreepsCard(name)); }
|
||||
public void FreepsChooseCard(PhysicalCardImpl card) throws DecisionResultInvalidException { FreepsChooseCards(card); }
|
||||
public void ShadowChooseCard(String name) throws DecisionResultInvalidException { ShadowChooseCards(GetShadowCard(name)); }
|
||||
public void ShadowChooseCard(PhysicalCardImpl card) throws DecisionResultInvalidException { ShadowChooseCards(card); }
|
||||
|
||||
public void FreepsChooseAnyCard() throws DecisionResultInvalidException { FreepsChoose(FreepsGetCardChoices().getFirst()); }
|
||||
public void ShadowChooseAnyCard() throws DecisionResultInvalidException { ShadowChoose(ShadowGetCardChoices().getFirst()); }
|
||||
|
||||
@@ -17,12 +17,28 @@ public class Card_15_193_Tests
|
||||
return new GenericCardTestHelper(
|
||||
new HashMap<>()
|
||||
{{
|
||||
put("card", "15_193");
|
||||
// put other cards in here as needed for the test case
|
||||
put("anotherway", "12_40");
|
||||
put("onegoodturn", "11_49");
|
||||
put("smeagol", "5_28");
|
||||
|
||||
put("leader", "12_34");
|
||||
put("gandalf", "1_364");
|
||||
|
||||
}},
|
||||
new HashMap<>() {{
|
||||
put("Mount Doom", "15_193");
|
||||
put("East Road", "11_236");
|
||||
put("Ettenmoors", "11_237");
|
||||
put("Fangorn Glade", "11_238");
|
||||
put("site5", "11_239");
|
||||
put("site6", "11_239");
|
||||
put("site7", "11_239");
|
||||
put("site8", "11_239");
|
||||
put("site9", "11_239");
|
||||
}},
|
||||
GenericCardTestHelper.FellowshipSites,
|
||||
GenericCardTestHelper.FOTRFrodo,
|
||||
GenericCardTestHelper.RulingRing
|
||||
GenericCardTestHelper.RulingRing,
|
||||
GenericCardTestHelper.Shadows
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,9 +60,7 @@ public class Card_15_193_Tests
|
||||
|
||||
var scn = GetScenario();
|
||||
|
||||
//Use this once you have set the deck up properly
|
||||
//var card = scn.GetFreepsSite();
|
||||
var card = scn.GetFreepsCard("card");
|
||||
var card = scn.GetFreepsCard("Mount Doom");
|
||||
|
||||
assertEquals("Mount Doom", card.getBlueprint().getTitle());
|
||||
assertNull(card.getBlueprint().getSubtitle());
|
||||
@@ -58,18 +72,93 @@ public class Card_15_193_Tests
|
||||
assertEquals(3, card.getBlueprint().getTwilightCost());
|
||||
}
|
||||
|
||||
// Uncomment any @Test markers below once this is ready to be used
|
||||
//@Test
|
||||
public void MountDoomTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
/**
|
||||
* Legacy Ruling #3 decided Mount Doom goes into effect immediately upon being played, and not
|
||||
* merely after a player has arrived at that site.
|
||||
*
|
||||
* <a href="https://wiki.lotrtcgpc.net/wiki/Legacy_Ruling_3">Legacy Ruling #3 on the wiki</a>
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void MountDoomCannotBeReplacedWhenItIsNextSite() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
//Pre-game setup
|
||||
var scn = GetScenario();
|
||||
|
||||
var card = scn.GetFreepsCard("card");
|
||||
scn.FreepsMoveCardToHand(card);
|
||||
var onegoodturn = scn.GetFreepsCard("onegoodturn");
|
||||
var smeagol = scn.GetFreepsCard("smeagol");
|
||||
var anotherway = scn.GetFreepsCard("anotherway");
|
||||
scn.FreepsMoveCardToSupportArea(anotherway);
|
||||
scn.FreepsMoveCharToTable(smeagol);
|
||||
scn.FreepsMoveCardToHand(onegoodturn);
|
||||
|
||||
scn.StartGame();
|
||||
scn.FreepsPlayCard(card);
|
||||
var site1 = scn.GetFreepsSite("East Road");
|
||||
var freepsSite3 = scn.GetFreepsSite("Fangorn Glade");
|
||||
var shadowSite2 = scn.GetShadowSite("Ettenmoors");
|
||||
var mountdoom = scn.GetFreepsSite("mountdoom");
|
||||
|
||||
assertEquals(3, scn.GetTwilight());
|
||||
scn.StartGame(site1);
|
||||
|
||||
//Start at East Road with player one
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
|
||||
//P1 then moves to P2 Ettenmoors
|
||||
scn.ShadowChooseCardBPFromSelection(shadowSite2);
|
||||
assertEquals(scn.GetCurrentSite(), shadowSite2);
|
||||
assertEquals(scn.GetSite(2), shadowSite2);
|
||||
|
||||
//P1 then stops and we reconcile
|
||||
scn.SkipToPhase(Phase.REGROUP);
|
||||
|
||||
//We now play One Good Turn Deserves Another: "Spot Sméagol to play the fellowship's next site.
|
||||
// Then you may add a burden to take this card back into hand."
|
||||
// Mount Doom should not be replaceable once it is played, even though no player is there yet.
|
||||
assertTrue(scn.FreepsPlayAvailable(onegoodturn));
|
||||
scn.FreepsPlayCard(onegoodturn);
|
||||
scn.FreepsChooseCard(mountdoom);
|
||||
assertEquals(scn.GetSite(3), mountdoom);
|
||||
scn.FreepsChooseYes(); //take One Good Turn back into hand
|
||||
|
||||
scn.ShadowPassCurrentPhaseAction();
|
||||
scn.FreepsPlayCard(onegoodturn);
|
||||
//This ensures that we have skipped over choosing a site and instead OGT has moved on to its other clause.
|
||||
assertTrue(scn.FreepsDecisionAvailable("Do you want to add a burden"));
|
||||
scn.FreepsChooseNo();
|
||||
assertNotEquals(scn.GetSite(3), freepsSite3);
|
||||
assertEquals(scn.GetSite(3), mountdoom);
|
||||
|
||||
//There's Another Way: "Discard this condition to replace the fellowship's current site with one
|
||||
// from your adventure deck." This can be activated but the replacement should completely fail,
|
||||
// since the current site (site 2) is in the same region as Mount Doom now.
|
||||
scn.ShadowPassCurrentPhaseAction();
|
||||
assertTrue(scn.FreepsActionAvailable(anotherway));
|
||||
scn.FreepsUseCardAction(anotherway);
|
||||
assertEquals(scn.GetCurrentSite(), shadowSite2);
|
||||
assertFalse(scn.FreepsAnyDecisionsAvailable());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void MountDoomCannotBeRemovedDuringTurnItsPlayed() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
//Pre-game setup
|
||||
var scn = GetScenario();
|
||||
|
||||
var anotherway = scn.GetFreepsCard("anotherway");
|
||||
scn.FreepsMoveCardToSupportArea(anotherway);
|
||||
|
||||
var site1 = scn.GetFreepsSite("East Road");
|
||||
var mountdoom = scn.GetShadowSite("Mount Doom");
|
||||
|
||||
scn.StartGame(site1);
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
|
||||
scn.ShadowChooseCardBPFromSelection(mountdoom);
|
||||
assertEquals(scn.GetCurrentSite(), mountdoom);
|
||||
scn.SkipToPhase(Phase.REGROUP);
|
||||
|
||||
//There's Another Way: "Discard this condition to replace the fellowship's current site with one
|
||||
// from your adventure deck." This can be activated but the replacement should completely fail.
|
||||
assertTrue(scn.FreepsActionAvailable(anotherway));
|
||||
scn.FreepsUseCardAction(anotherway);
|
||||
assertEquals(scn.GetCurrentSite(), mountdoom);
|
||||
assertFalse(scn.FreepsAnyDecisionsAvailable());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user