public void SetAttributeCheckCondition(CharacterAttribute stat, int value, InequalityTypes type)
    {
        conditionTypeSet = ConditionTypes.AttributeCheck;

        if (attributeCheckCondition == null)
        {
            attributeCheckCondition = new AttributeCheckCondition();
        }

        attributeCheckCondition.Attribute      = stat;
        attributeCheckCondition.ValueChecked   = value;
        attributeCheckCondition.InequalityType = type;
    }
示例#2
0
        public void IsConditionFulfilledLessOrEqualShouldBeEqualAssert(string stat,
                                                                       string value,
                                                                       int enemyValue,
                                                                       bool assertValue)
        {
            var c = new AttributeCheckCondition(stat, "lessOrEqual", value, string.Empty);
            var e = new Mock <IEnemy>();

            e.Setup(s => s.Skill)
            .Returns(enemyValue);

            e.Setup(s => s.CombatTurn)
            .Returns(enemyValue);

            e.Setup(s => s.Stamina)
            .Returns(enemyValue);

            var result = c.IsConditionFulfilled(null, e.Object);

            Assert.Equal(assertValue, result);
        }