Exemplo n.º 1
0
        public void WhenCastSpell()
        {
            DeadlyPoison deadlyPoison = SetTestedCardInHand <DeadlyPoison>();
            BladeFlurry  bladeFlurry  = SetTestedCardInHand <BladeFlurry>();
            Preparation  preparation  = SetTestedCardInHand <Preparation>();
            Sprint       sprint       = SetTestedCardInHand <Sprint>();

            GameResult <GameContextOutput> res = proxy.CastSpell(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, preparation.CardInGameCode, -1) as GameResult <GameContextOutput>;

            Xunit.Assert.True(res.code == (int)OperateResCodeEnum.成功);
            Xunit.Assert.True(deadlyPoison.Cost == -2 && bladeFlurry.Cost == -1 && sprint.Cost == 4);
            Xunit.Assert.True(preparation.Cost == 0);
        }
Exemplo n.º 2
0
        public void AttackedAndCastSpell()
        {
            BladeFlurry bladeFlurry = SetTestedCardInHand <BladeFlurry>();

            proxy.CastHeroPower(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, -1);

            BaseHero enemyHero = gameContext.DeskCards[8] as BaseHero;
            GameResult <GameContextOutput> res = proxy.HeroAttack(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, 8) as GameResult <GameContextOutput>;

            Xunit.Assert.True(res.code == (int)OperateResCodeEnum.成功);
            Xunit.Assert.True(enemyHero.Life == 29);

            res = proxy.CastSpell(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, bladeFlurry.CardInGameCode, -1) as GameResult <GameContextOutput>;
            BaseHero hero = gameContext.DeskCards[0] as BaseHero;

            Xunit.Assert.True(hero.Equip == null && gameContext.GetActivationUserContext().GraveyardCards.Any(c => c.CardInGameCode == bladeFlurry.CardInGameCode));
            Xunit.Assert.True(enemyHero.Life == 28);
        }
Exemplo n.º 3
0
        public void CastSpellFromUpgradeWeapon()
        {
            DeadlyPoison deadlyPoison = SetTestedCardInHand <DeadlyPoison>();
            BladeFlurry  bladeFlurry  = SetTestedCardInHand <BladeFlurry>();

            Voidwalker voidwalker = gameContext.GetNotActivationUserContext().AllCards.First(c => c.GetType() == typeof(Voidwalker)) as Voidwalker;

            SetCardInDesk(voidwalker);

            proxy.CastHeroPower(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, -1);
            GameResult <GameContextOutput> res = proxy.CastSpell(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, deadlyPoison.CardInGameCode, -1) as GameResult <GameContextOutput>;

            Xunit.Assert.True(res.code == (int)OperateResCodeEnum.成功);
            res = proxy.CastSpell(gameContext.GameCode, gameContext.GetActivationUserContext().UserCode, bladeFlurry.CardInGameCode, -1) as GameResult <GameContextOutput>;
            Xunit.Assert.True(res.code == (int)OperateResCodeEnum.成功);
            BaseHero hero = gameContext.DeskCards[0] as BaseHero;

            Xunit.Assert.True(hero.Equip == null && gameContext.GetActivationUserContext().GraveyardCards.Any(c => c.CardInGameCode == bladeFlurry.CardInGameCode));
            BaseHero enemyHero = gameContext.DeskCards[8] as BaseHero;

            Xunit.Assert.True(enemyHero.Life == 27);
            Xunit.Assert.True(gameContext.GetNotActivationUserContext().GraveyardCards.Any(c => c.CardInGameCode == voidwalker.CardInGameCode));
        }