public void Integer_Attribute_Correctly_Adds_Percent_Mod(int dfValue, float pctMod, int expected) { RPGAttribute attr = Substitute.ForPartsOf <RPGAttribute>(AttributeType.Integer, dfValue); IAttributeMod mod = attr.AddPercentModifier(pctMod); Assert.AreEqual(expected, mod.ValueAsInt()); Assert.AreEqual(expected, mod.ValueAsFloat()); }
public void Float_Attribute_Correctly_Adds_Flat_Mod(float flatMod) { RPGAttribute attr = Setup(AttributeType.Float); IAttributeMod mod = attr.AddFlatModifier(flatMod); float modVal = flatMod; Assert.AreEqual((int)modVal, mod.ValueAsInt()); Assert.AreEqual(modVal, mod.ValueAsFloat()); }