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)); }
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)); }
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)); }
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); }
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); }