示例#1
0
        public void Greater_Default()
        {
            // Arrange
            var enchantment = new Shadow(ShadowStrength.Greater);

            // Assert
            Assert.AreEqual("Greater Shadow", 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.Illusion == s));
            Assert.Throws <ArgumentNullException>(() => enchantment.ApplyTo(null));
        }
示例#2
0
        public void Improved_ApplyTo()
        {
            // Arrange
            var competenceBonusTracker = Mock.Of <IModifierTracker>();
            var mockCharacter          = new Mock <ICharacter>();

            mockCharacter.Setup(c => c.Skills.Stealth.CompetenceBonuses)
            .Returns(competenceBonusTracker);
            var enchantment = new Shadow(ShadowStrength.Improved);

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

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