public void ApplyTo_NullICharacter_Throws() { // Arrange ICharacter character = null; HandOfTheMage item = new HandOfTheMage(); // Act TestDelegate apply = () => item.ApplyTo(character); // Assert Assert.Throws <ArgumentNullException>(apply); }
public void ApplyTo() { // Assert var slaKnown = Mock.Of <ISpellLikeAbilityCollection>(); var mockCharacter = new Mock <ICharacter>(); mockCharacter.Setup(c => c.SpellLikeAbilities.Known) .Returns(slaKnown); HandOfTheMage item = new HandOfTheMage(); // Act item.ApplyTo(mockCharacter.Object); // Assert Mock.Get(slaKnown) .Verify(r => r.Add(It.Is <ISpellLikeAbility>(sla => sla.Spell is MageHand && 0 == sla.UsesPerDay && 2 == sla.CasterLevel.GetTotal() && 0 == sla.Spell.Level)), "Hand of the Mage should add a level 0 Mage Hand as a spell-like ability known allowing unlimited uses per day with a casting stat of 10."); }