Package org.mage.test.clientside.bdd

Examples of org.mage.test.clientside.bdd.StepState


    private StepState step;
    public Phase(StepState step) {
        this.step = step;
    }
    public void is(String phase, MageAPI.Owner owner) throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.GIVEN)) {
            if ("Precombat Main".equals(phase) && (owner.equals(mine) || owner.equals(me))) {
                MageBase.getInstance().goToPhase("Precombat Main - play spells and sorceries.");
                return;
            }
            System.err.println("waitForPhase not implemented for phase="+phase+", owner="+owner.name());
View Full Code Here


    private StepState step;
    public Graveyards(StepState step) {
        this.step = step;
    }
    public boolean empty() throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.THEN)) {
            boolean empty = MageBase.getInstance().checkGraveyardsEmpty();
            Assert.assertThat(empty, is(true));
            return empty;
        } else {
            throw new AssertionError("Not implemented for step="+current);
View Full Code Here

    private StepState step;
    public Battlefield(StepState step) {
        this.step = step;
    }
    public boolean has(String cardName) throws Exception {
        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 Full Code Here

    private StepState step;
    public A(StepState step) {
        this.step = step;
    }
    public void card(String cardName) throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.GIVEN)) {
            if (!MageBase.getInstance().giveme(cardName)) {
                throw new CardNotFoundException("Couldn't create card: " + cardName);
            }
        } else if (current.equals(StepState.THEN)) {
            if (!MageBase.getInstance().checkIhave(cardName)) {
                throw new CardNotFoundException("Couldn't find requested card in hand: " + cardName);
            }
        }
    }
View Full Code Here

     *
     * @param step
     * @return
     */
    public static StepState defineStep(StepState step) {
        StepState current = step;
        if (!step.equals(StepState.UNKNOWN)) {
            StepController.currentState = step;
        } else {
            current = StepController.currentState;
        }
View Full Code Here

TOP

Related Classes of org.mage.test.clientside.bdd.StepState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.