示例#1
0
        public void CantAttackNotExistingCreatureCreature()
        {
            var state  = CreateCreatureAttackReadyState();
            var action = new AttackCreatureAction("1", 0, -1);

            Assert.False(action.CanApply(state));
            action = new AttackCreatureAction("1", 0, 1);
            Assert.False(action.CanApply(state));
        }
示例#2
0
        public void CantAttackCreatureWithoutCreature()
        {
            var state  = CreateCreatureAttackReadyState();
            var action = new AttackCreatureAction("1", -1, 0);

            Assert.False(action.CanApply(state));
            action = new AttackCreatureAction("1", 1, 0);
            Assert.False(action.CanApply(state));
        }
示例#3
0
        public void CantAttackCreatueByInactiveCreature()
        {
            var state    = CreateCreatureAttackReadyState();
            var userCard = state.Users[0].TableSet[0];

            userCard.Actions = 0;
            var action = new AttackCreatureAction("1", 0, 0);

            Assert.False(action.CanApply(state));
        }
示例#4
0
        public void CreatureAttackSpentActions()
        {
            var state    = CreateCreatureAttackReadyState();
            var userCard = state.Users[0].TableSet[0];
            var action   = new AttackCreatureAction("1", 0, 0);

            Assert.True(action.CanApply(state));
            action.Apply(state);
            Assert.True(userCard.Actions < userCard.MaxActions);
        }
示例#5
0
        public void CreatureLostHealth()
        {
            var state     = CreateCreatureAttackReadyState();
            var userCard  = state.Users[0].TableSet[0];
            var enemyCard = state.Users[1].TableSet[0];

            enemyCard.Health = enemyCard.MaxHealth = userCard.Damage + 1;
            var action = new AttackCreatureAction("1", 0, 0);

            Assert.True(action.CanApply(state));
            action.Apply(state);
            Assert.True(enemyCard.Health == enemyCard.MaxHealth - userCard.Damage);
        }