public void ApplyTo_NullICharacter() { // Arrange var enchantment = new Reflecting(); // Act TestDelegate applyTo = () => enchantment.ApplyTo(null); // Assert Assert.Throws <ArgumentNullException>(applyTo); }
public void ApplyTo_Character_SpellLikeAbility() { // Arrange var slaKnown = Mock.Of <ISpellLikeAbilityCollection>(); var mockCharacter = new Mock <ICharacter>(); mockCharacter.Setup(c => c.SpellLikeAbilities.Known) .Returns(slaKnown); var enchantment = new Reflecting(); // Act enchantment.ApplyTo(mockCharacter.Object); // Assert Mock.Get(slaKnown) .Verify(r => r.Add(It.Is <ISpellLikeAbility>(sla => sla.Spell is SpellTurning && 1 == sla.UsesPerDay && 14 == sla.CasterLevel.GetTotal() && 7 == sla.Spell.Level)), "Applying a Reflecting shield enchantment to a character should let the character cast Spell Turnng once per day at caster level 14 using an ability score of 17."); }