Added Relics of Moria unit tests for both original and errata

This commit is contained in:
Christian 'ketura' McCarty
2022-08-19 19:28:47 -05:00
parent c5a84e0338
commit c50b9d60c5
2 changed files with 184 additions and 11 deletions

View File

@@ -0,0 +1,107 @@
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.HashMap;
import static org.junit.Assert.*;
public class Card_1_195_Tests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("relics", "1_195");
put("runner", "1_178");
put("scimitar", "1_180");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
);
}
@Test
public void RelicsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 1
* Title: Relics of Moria
* Unique: false
* Side: Shadow
* Culture: Moria
* Twilight Cost: 1
* Type: Condition
* Subtype: Support Area
* Game Text: Plays to your support area.
* Shadow: Remove (2) to play a [MORIA] possession from your discard pile.
*/
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl relics = scn.GetFreepsCard("relics");
assertFalse(relics.getBlueprint().isUnique());
assertEquals(Side.SHADOW, relics.getBlueprint().getSide());
assertEquals(Culture.MORIA, relics.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, relics.getBlueprint().getCardType());
assertEquals(1, relics.getBlueprint().getTwilightCost());
assertTrue(scn.HasKeyword(relics, Keyword.SUPPORT_AREA));
}
@Test
public void ShadowAbilityRemoves2ToPlayMoriaPossessionFromDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var relics = scn.GetShadowCard("relics");
var runner = scn.GetShadowCard("runner");
var scimitar = scn.GetShadowCard("scimitar");
scn.ShadowMoveCardToSupportArea(relics);
scn.ShadowMoveCharToTable(runner);
scn.ShadowMoveCardToDiscard(scimitar);
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
assertEquals(3, scn.GetTwilight());
assertEquals(Zone.DISCARD, scimitar.getZone());
assertTrue(scn.ShadowActionAvailable(relics));
scn.ShadowUseCardAction(relics);
assertEquals(1, scn.GetTwilight());
assertEquals(Zone.ATTACHED, scimitar.getZone());
assertFalse(scn.ShadowActionAvailable(relics));
}
@Test
public void ShadowAbilityNotAvailableIfNoPossessionsInDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var relics = scn.GetShadowCard("relics");
var runner = scn.GetShadowCard("runner");
var scimitar = scn.GetShadowCard("scimitar");
scn.ShadowMoveCardToSupportArea(relics);
scn.ShadowMoveCharToTable(runner);
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
assertEquals(Zone.DECK, scimitar.getZone());
assertEquals(0, scn.GetShadowDiscardCount());
assertFalse(scn.ShadowActionAvailable(relics));
}
}

View File

@@ -1,9 +1,7 @@
package com.gempukku.lotro.cards.unofficial.pc.errata.set01;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
@@ -12,17 +10,23 @@ import org.junit.Test;
import java.util.HashMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
public class Card_01_195_ErrataTests
{
protected GenericCardTestHelper GetSimpleDeckScenario() throws CardNotFoundException, DecisionResultInvalidException {
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>() {{
new HashMap<String, String>()
{{
put("relics", "51_195");
}}
put("runner", "1_178");
put("scimitar", "1_180");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
);
}
@@ -30,14 +34,76 @@ public class Card_01_195_ErrataTests
@Test
public void RelicsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 1
* Title: Relics of Moria
* Unique: true
* Side: Shadow
* Culture: Moria
* Twilight Cost: 1
* Type: Condition
* Subtype: Support Area
* Game Text: Plays to your support area.
* Shadow: Remove (2) to play a [MORIA] possession from your discard pile.
*/
//Pre-game setup
GenericCardTestHelper scn = GetSimpleDeckScenario();
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl relics = scn.GetFreepsCard("relics");
assertTrue(relics.getBlueprint().isUnique());
assertEquals(CardType.CONDITION, relics.getBlueprint().getCardType());
assertEquals(Side.SHADOW, relics.getBlueprint().getSide());
assertEquals(Culture.MORIA, relics.getBlueprint().getCulture());
Assert.assertTrue(scn.HasKeyword(relics, Keyword.SUPPORT_AREA));
assertEquals(CardType.CONDITION, relics.getBlueprint().getCardType());
assertEquals(1, relics.getBlueprint().getTwilightCost());
assertTrue(scn.HasKeyword(relics, Keyword.SUPPORT_AREA));
}
@Test
public void ShadowAbilityRemoves2ToPlayMoriaPossessionFromDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var relics = scn.GetShadowCard("relics");
var runner = scn.GetShadowCard("runner");
var scimitar = scn.GetShadowCard("scimitar");
scn.ShadowMoveCardToSupportArea(relics);
scn.ShadowMoveCharToTable(runner);
scn.ShadowMoveCardToDiscard(scimitar);
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
assertEquals(3, scn.GetTwilight());
assertEquals(Zone.DISCARD, scimitar.getZone());
assertTrue(scn.ShadowActionAvailable(relics));
scn.ShadowUseCardAction(relics);
assertEquals(1, scn.GetTwilight());
assertEquals(Zone.ATTACHED, scimitar.getZone());
assertFalse(scn.ShadowActionAvailable(relics));
}
@Test
public void ShadowAbilityNotAvailableIfNoPossessionsInDiscard() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var relics = scn.GetShadowCard("relics");
var runner = scn.GetShadowCard("runner");
var scimitar = scn.GetShadowCard("scimitar");
scn.ShadowMoveCardToSupportArea(relics);
scn.ShadowMoveCharToTable(runner);
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
assertEquals(Zone.DECK, scimitar.getZone());
assertEquals(0, scn.GetShadowDiscardCount());
assertFalse(scn.ShadowActionAvailable(relics));
}
}