Trouble writing a test for counters added at upkeep
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
Trouble writing a test for counters added at upkeep
by catsmdogs » 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);
}
- catsmdogs
- Posts: 3
- Joined: 20 Nov 2018, 22:42
- Has thanked: 0 time
- Been thanked: 0 time
Re: Trouble writing a test for counters added at upkeep
by catsmdogs » 21 Nov 2018, 00:53
u/emerald000 got back to me on the xmage subreddit: the setStopAt takes half-turns compared to the way I was thinking of turns.
(This forum didn't like a brand new user posting an off-site link)
(This forum didn't like a brand new user posting an off-site link)
- catsmdogs
- Posts: 3
- Joined: 20 Nov 2018, 22:42
- Has thanked: 0 time
- Been thanked: 0 time
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests