Ejemplo n.º 1
0
        public void Greater_Default()
        {
            // Arrange
            var enchantment = new Slick(SlickStrength.Greater);

            // Assert
            Assert.AreEqual("Greater Slick", enchantment.Name.Text);
            Assert.AreEqual(0, enchantment.SpecialAbilityBonus);
            Assert.AreEqual(33750, enchantment.Cost);
            Assert.AreEqual(15, enchantment.CasterLevel);
            Assert.That(enchantment.GetSchools(),
                        Has.Exactly(1).Matches <School>(s => School.Conjuration == s));
            Assert.Throws <ArgumentNullException>(() => enchantment.ApplyTo(null));
        }
Ejemplo n.º 2
0
        public void Improved_ApplyTo()
        {
            // Arrange
            var competenceBonusTracker = Mock.Of <IModifierTracker>();
            var mockCharacter          = new Mock <ICharacter>();

            mockCharacter.Setup(c => c.Skills.EscapeArtist.CompetenceBonuses)
            .Returns(competenceBonusTracker);
            var enchantment = new Slick(SlickStrength.Improved);

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

            // Assert
            Mock.Get(competenceBonusTracker)
            .Verify(er => er.Add(It.Is <Func <byte> >(calc => 10 == calc())),
                    "Improved Slick should give a +10 competence bonus to a character's Escape Artist skill.");
        }