public void AbilityStatModifiersTrackChangesToAbility() { var ability = new AbilityScore(); ability.SetValue(10); var modifier = new AbilityStatModifier(ability); Assert.AreEqual(0, modifier.Modifier); ability.SetValue(20); Assert.AreEqual(05, modifier.Modifier); }
public void AbilityStatModifiersTrackChangesToAbility() { var ability = new AbilityScore(AbilityScoreTypes.Strength, 10); var modifier = new AbilityStatModifier(ability); Assert.Equal(0, modifier.Modifier); ability.SetValue(20); Assert.Equal(05, modifier.Modifier); }
public void SkillsRecalculateWhenAbilityIsUpdated() { var skill = new Skill("Chew", AbilityScoreTypes.Strength, false); var ability = new AbilityScore(AbilityScoreTypes.Strength, 10); var charSkill = new CharacterSkill(skill, ability, false); var oldVal = charSkill.Score(); ability.SetValue(16); Assert.Greater(charSkill.Score(), oldVal); }
public void IfAbilityIsNegativeModifierJustUseZero() { var ability = new AbilityScore(AbilityScoreTypes.Strength, 6); var modifier = new PositiveAbilityStatModifier(ability); Assert.Equal(modifier.Modifier, 0); //Setting the ability positive generates a good value ability.SetValue(20); Assert.Equal(modifier.Modifier, 5); }