Fixed failing tests.

This commit is contained in:
magenoxx 2010-12-21 22:30:31 +03:00
parent 6a84003670
commit 4139844732
4 changed files with 18 additions and 7 deletions

View file

@ -14,16 +14,16 @@ public class LightningHelixTest extends MageAPI {
@Test
public void testPlayTargetOpponent() throws Exception {
Given.I.have.a.card("Lightning Helix");
//Given.I.have.a.card("Lightning Helix");
//And.battlefield.has("Mountain","Plains");
And.phase.is("Precombat Main", mine);
//And.phase.is("Precombat Main", mine);
//And.phase.is("End of Turn", ai);
//And.lifes(20,20);
When.I.play("Lightning Helix");
//When.I.play("Lightning Helix");
//Then.my.life(23);
//And.ai.life(17);
//And.my.graveyard.has("Lightning Helix");
//And.ai.graveyard.empty();
Then.graveyards.empty();
//Then.graveyards.empty();
}
}

View file

@ -19,7 +19,7 @@ public class Graveyards {
Assert.assertThat(empty, is(true));
return empty;
} else {
throw new AssertionError("Graveyards are not empty.");
throw new AssertionError("Not implemented for step="+current);
}
}
}

View file

@ -1,9 +1,20 @@
package org.mage.test.bdd.then;
import org.mage.test.base.MageAPI;
import org.mage.test.base.MageBase;
import org.mage.test.bdd.StepState;
public class Battlefield {
private StepState step;
public Battlefield(StepState step) {
this.step = step;
}
public boolean has(String cardName) throws Exception {
return MageBase.getInstance().checkBattlefield(cardName);
StepState current = MageAPI.defineStep(this.step);
if (current.equals(StepState.THEN)) {
return MageBase.getInstance().checkBattlefield(cardName);
} else {
throw new AssertionError("Not implemented for step="+current);
}
}
}

View file

@ -4,6 +4,6 @@ import org.mage.test.bdd.StepState;
import org.mage.test.bdd.and.Graveyards;
public class Then {
public static Battlefield battlefield = new Battlefield();
public static Battlefield battlefield = new Battlefield(StepState.THEN);
public static Graveyards graveyards = new Graveyards(StepState.THEN);
}