some set 3 PC errata unit tests

This commit is contained in:
Christian 'ketura' McCarty
2023-09-13 02:40:17 -05:00
parent bc94625a6a
commit 21e3b09dba
6 changed files with 220 additions and 25 deletions

View File

@@ -0,0 +1,204 @@
package com.gempukku.lotro.cards.unofficial.pc.errata.set03;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test;
import java.util.HashMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class Card_03_004_ErrataTests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>()
{{
put("welcome", "53_4");
put("gimli", "1_13");
put("thrarin", "1_27");
put("elrond", "1_40");
put("cantea", "1_230");
put("lemenya", "1_232");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.RulingRing
);
}
@Test
public void ARoyalWelcomeStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 3
* Title: A Royal Welcome
* Unique: False
* Side: FREE_PEOPLE
* Culture: Dwarven
* Twilight Cost: 2
* Type: condition
* Subtype:
* Game Text: Fellowship: Exert a [dwarven] companion to heal a [dwarven] ally.
* Skirmish: Spot a [dwarven] companion skirmishing a minion of strength 10 or more and exert a [dwarven] ally to make that companion strength +2.
* Regroup: Exert a [dwarven] ally to heal a [dwarven] companion.
*/
//Pre-game setup
var scn = GetScenario();
var welcome = scn.GetFreepsCard("welcome");
assertFalse(welcome.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, welcome.getBlueprint().getSide());
assertEquals(Culture.DWARVEN, welcome.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, welcome.getBlueprint().getCardType());
assertTrue(scn.HasKeyword(welcome, Keyword.SUPPORT_AREA));
assertEquals(2, welcome.getBlueprint().getTwilightCost());
}
@Test
public void ARoyalWelcomeFellowshipAbilityHealsDwarvenAllyWithDwarvenCompanion() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var welcome = scn.GetFreepsCard("welcome");
var gimli = scn.GetFreepsCard("gimli");
var thrarin = scn.GetFreepsCard("thrarin");
var elrond = scn.GetFreepsCard("elrond");
scn.FreepsMoveCardToSupportArea(welcome, elrond, thrarin);
scn.FreepsMoveCharToTable(gimli);
scn.StartGame();
scn.AddWoundsToChar(thrarin, 1);
scn.AddWoundsToChar(gimli, 1);
assertEquals(1, scn.GetWoundsOn(gimli));
assertEquals(1, scn.GetWoundsOn(thrarin));
assertTrue(scn.FreepsActionAvailable(welcome));
scn.FreepsUseCardAction(welcome);
assertEquals(2, scn.GetWoundsOn(gimli));
assertEquals(0, scn.GetWoundsOn(thrarin));
//Gimli's out of vitality
assertFalse(scn.FreepsActionAvailable(welcome));
}
@Test
public void ARoyalWelcomeRegroupAbilityHealsDwarvenCompWithDwarvenAlly() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var welcome = scn.GetFreepsCard("welcome");
var gimli = scn.GetFreepsCard("gimli");
var thrarin = scn.GetFreepsCard("thrarin");
var elrond = scn.GetFreepsCard("elrond");
scn.FreepsMoveCardToSupportArea(welcome, elrond, thrarin);
scn.FreepsMoveCharToTable(gimli);
scn.AddWoundsToChar(gimli, 2);
scn.StartGame();
scn.SkipToPhase(Phase.REGROUP);
assertEquals(2, scn.GetWoundsOn(gimli));
assertEquals(0, scn.GetWoundsOn(thrarin));
assertTrue(scn.FreepsActionAvailable(welcome));
scn.FreepsUseCardAction(welcome);
assertEquals(1, scn.GetWoundsOn(gimli));
assertEquals(1, scn.GetWoundsOn(thrarin));
//Thrarin's out of vitality
assertFalse(scn.FreepsActionAvailable(welcome));
}
@Test
public void ARoyalWelcomeSkirmishAbilityDoesNotWorkIfNoDwarfAllyVitality() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var welcome = scn.GetFreepsCard("welcome");
var gimli = scn.GetFreepsCard("gimli");
var thrarin = scn.GetFreepsCard("thrarin");
var elrond = scn.GetFreepsCard("elrond");
scn.FreepsMoveCardToSupportArea(welcome, elrond, thrarin);
scn.FreepsMoveCharToTable(gimli);
var cantea = scn.GetShadowCard("cantea");
var lemenya = scn.GetShadowCard("lemenya");
scn.ShadowMoveCharToTable(cantea, lemenya);
scn.StartGame();
scn.AddWoundsToChar(thrarin, 1);
scn.SkipToAssignments();
scn.FreepsAssignToMinions(gimli, cantea);
scn.ShadowDeclineAssignments();
scn.FreepsResolveSkirmish(gimli);
assertEquals(1, scn.GetVitality(thrarin));
assertFalse(scn.FreepsActionAvailable(welcome));
}
@Test
public void ARoyalWelcomeSkirmishAbilityExertsDwarvenAllyIfDwarfSkirmishes10StrMinion() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var welcome = scn.GetFreepsCard("welcome");
var gimli = scn.GetFreepsCard("gimli");
var thrarin = scn.GetFreepsCard("thrarin");
var elrond = scn.GetFreepsCard("elrond");
scn.FreepsMoveCardToSupportArea(welcome, elrond, thrarin);
scn.FreepsMoveCharToTable(gimli);
var cantea = scn.GetShadowCard("cantea");
var lemenya = scn.GetShadowCard("lemenya");
scn.ShadowMoveCharToTable(cantea, lemenya);
scn.StartGame();
scn.SkipToAssignments();
scn.FreepsAssignToMinions(gimli, lemenya);
scn.ShadowDeclineAssignments();
scn.FreepsResolveSkirmish(gimli);
assertEquals(2, scn.GetVitality(thrarin));
assertEquals(6, scn.GetStrength(gimli));
assertEquals(9, scn.GetStrength(lemenya));
assertFalse(scn.FreepsActionAvailable(welcome));
scn.PassCurrentPhaseActions();
//Fierce assignment
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(gimli, cantea);
//lemenya is not fierce
scn.FreepsResolveSkirmish(gimli);
assertEquals(2, scn.GetVitality(thrarin));
assertEquals(6, scn.GetStrength(gimli));
assertEquals(10, scn.GetStrength(cantea));
assertTrue(scn.FreepsActionAvailable(welcome));
scn.FreepsUseCardAction(welcome);
assertEquals(1, scn.GetVitality(thrarin));
assertEquals(8, scn.GetStrength(gimli));
}
}

View File

@@ -19,13 +19,13 @@ public class Card_03_017_ErrataTests
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<String, String>()
new HashMap<>()
{{
put("galadriel", "53_17");
put("celeborn", "1_34");
put("greenleaf", "1_50");
}},
new HashMap<String, String>() {{
new HashMap<>() {{
put("site1", "1_319");
put("site2", "1_332");
put("site3", "1_337");
@@ -46,12 +46,12 @@ public class Card_03_017_ErrataTests
protected GenericCardTestHelper GetExpandedScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<String, String>()
new HashMap<>()
{{
put("galadriel", "53_17");
// put other cards in here as needed for the test case
}},
new HashMap<String, String>() {{
new HashMap<>() {{
put("site1", "1_319");
put("site2", "1_332");
put("site3", "1_337");
@@ -104,9 +104,7 @@ public class Card_03_017_ErrataTests
assertEquals(3, galadriel.getBlueprint().getTwilightCost());
assertEquals(3, galadriel.getBlueprint().getStrength());
assertEquals(3, galadriel.getBlueprint().getVitality());
//assertEquals(, galadriel.getBlueprint().getResistance());
//assertEquals(Signet., galadriel.getBlueprint().getSignet());
assertEquals(6, galadriel.getBlueprint().getAllyHomeSiteNumbers()[0]); // Change this to getAllyHomeSiteNumbers for allies
assertEquals(6, galadriel.getBlueprint().getAllyHomeSiteNumbers()[0]);
assertEquals(SitesBlock.FELLOWSHIP, galadriel.getBlueprint().getAllyHomeSiteBlock());
}
@@ -124,7 +122,6 @@ public class Card_03_017_ErrataTests
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
//We have to specify which site here since we cheated and included a second site 2

View File

@@ -46,7 +46,8 @@ public class Card_03_027_ErrataTests
* Subtype: Ring
* Vitality: 1
* Game Text: Bearer must be Elrond.
* <b>Maneuver:</b> Exert Elrond and spot a Shadow condition to return that condition to its owner's hand. That player may discard a vilya from hand. Return Vilya to your hand.
* <b>Maneuver:</b> Exert Elrond and spot a Shadow condition to return that condition to its owner's hand.
* That player may discard a card from hand. Return Vilya to your hand.
*/
//Pre-game setup

View File

@@ -1,9 +1,7 @@
package com.gempukku.lotro.cards.unofficial.pc.errata.set03;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Signet;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
@@ -28,16 +26,6 @@ public class Card_03_038_ErrataTests
);
}
@Test
public void AragornHasRanger() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
}
@Test
public void AragornStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
@@ -59,13 +47,17 @@ public class Card_03_038_ErrataTests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
var aragorn = scn.GetFreepsCard("aragorn");
assertTrue(aragorn.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, aragorn.getBlueprint().getSide());
assertEquals(Culture.GONDOR, aragorn.getBlueprint().getCulture());
assertEquals(CardType.COMPANION, aragorn.getBlueprint().getCardType());
assertEquals(Race.MAN, aragorn.getBlueprint().getRace());
assertEquals(4, aragorn.getBlueprint().getTwilightCost());
assertEquals(8, aragorn.getBlueprint().getStrength());
assertEquals(4, aragorn.getBlueprint().getVitality());
assertEquals(6, aragorn.getBlueprint().getResistance());
assertEquals(Signet.FRODO, aragorn.getBlueprint().getSignet());
assertTrue(scn.HasKeyword(aragorn, Keyword.RANGER));

View File

@@ -55,7 +55,8 @@ public class Card_03_042_ErrataTests
* Twilight Cost: 1
* Type: Possession
* Errata Game Text: Bearer must be Boromir.
* Maneuver: Exert Boromir and discard this possession to spot an ally. Until the regroup phase, that ally is strength +3 and participates in archery fire and skirmishes.
* Maneuver: Exert Boromir and discard this possession to spot an ally. Until the regroup phase,
* that ally is strength +3 and participates in archery fire and skirmishes.
*/
//Pre-game setup