Trouble writing a test for counters added at upkeep
Posted: 20 Nov 2018, 22:47
With manual testing I can see that Assemble the Legion gets muster counters when expected, and cumulative upkeep cards like Reality Twist get age counters when expected, and the cost to keep it accumulates.
But in a unit test I don't see the counters rising. Any bugs in my test?
But in a unit test I don't see the counters rising. Any bugs in my test?
- Code: Select all
@Test
public void testTrackCounters() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 20);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.HAND, playerA, "Reality Twist", 1);
addCard(Zone.HAND, playerA, "Assemble the Legion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Assemble the Legion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reality Twist");
setChoice(playerA, "Yes"); // Pay cumulative upkeep?
setChoice(playerA, "Yes"); // Pay cumulative upkeep?
setChoice(playerA, "Yes"); // Pay cumulative upkeep?
setStopAt(4, PhaseStep.PRECOMBAT_MAIN);
execute();
// Counter counts are not equal (Assemble the Legion:MUSTER) expected:<3> but was:<1>
assertCounterCount(playerA, "Assemble the Legion", CounterType.MUSTER, 3);
// Counter counts are not equal (Reality Twist:AGE) expected:<3> but was:<1>
assertCounterCount(playerA, "Reality Twist", CounterType.AGE, 3);
}