Exemplo n.º 1
0
        public void ApplyTo_NullICharacter_Throws()
        {
            // Arrange
            var enchantment = new SpellResistance(SpellResistanceMagnitude.SR13);

            // Act
            TestDelegate applyTo = () => enchantment.ApplyTo(null);

            // Assert
            Assert.Throws <ArgumentNullException>(applyTo);
        }
Exemplo n.º 2
0
        public void SpellResistance_15_ApplyTo()
        {
            // Arrange
            var spellResistanceTracker = Mock.Of <IModifierTracker>();
            var mockCharacter          = new Mock <ICharacter>();

            mockCharacter.Setup(c => c.SpellResistance)
            .Returns(spellResistanceTracker);

            var enchantment = new SpellResistance(SpellResistanceMagnitude.SR15);

            // Act
            enchantment.ApplyTo(mockCharacter.Object);

            // Assert
            Mock.Get(spellResistanceTracker)
            .Verify(srt => srt.Add(It.Is <Func <byte> >(calc => 15 == calc())),
                    "Applying a Spell Reistance (15) enchantment to a character should give the character 15 spell resistance.");
        }