public void ChecksWieldingByLevel()
        {
            var character = new Wizard
            {
                Experience = 1000
            };
            var item1 = new Staff
            {
                MinLevel = 5
            };

            var result1 =
                _god.Says(character).Can.Wield(item1);

            Assert.That(result1, Is.True, "Failed for legal item.");

            var item2 = new Staff
            {
                MinLevel = 100
            };
            var result2 =
                _god.Says(character).Can.Wield(item2);

            Assert.That(result2, Is.False, "Failed for illegal item.");
        }
        public void RefusesWieldingIllegalItem()
        {
            var character = new Wizard() {WieldedWeapon = new IronDagger()};
            var item = new IronDagger();

            var result =
                _god.Says(character).Can.Wield(item);

            Assert.That(result, Is.False);
        }
        public void AcceptsEquipingArmor()
        {
            var character = new Wizard();
            var item = new ClothArmor();

            var result =
                _god.Says(character).Can.Equip(item);

            Assert.That(result, Is.True);
        }
        public void CantEquipHighLevelArmors()
        {
            var character = new Wizard();
            var item = new ClothArmor
            {
                MinLevel = 15
            };

            var result =
                _god.Says(character).Can.Equip(item);

            Assert.That(result, Is.False);
        }
        public void AcceptsWieldingLegal()
        {
            var character = new Wizard
            {
                Experience = Int32.MaxValue
            };
            var item = new Staff();

            var result =
                _god.Says(character).Can.Wield(item);

            Assert.That(result, Is.True);
        }
Ejemplo n.º 6
0
 public void WizardLevelsUp()
 {
     var wizard = new Wizard();
     wizard.Experience += 300d;
     Assert.That(wizard.Level, Is.AtLeast(2));
 }
        public void RefuseAttackIllegalObject()
        {
            var character = new Wizard() {WieldedWeapon = new IronDagger()};
            var item = new IronDagger();
            
            var result = _god.Says(character).Can.Attack(item);
            Assert.That(result,Is.False);

        }
 public void AcceptAttackLegalObject()
 {
     var character = new Wizard() {WieldedWeapon = new IronDagger()};
     var character2 = new Wizard();
     var item = new IronDagger();
     var result = _god.Says(character).Can.Attack(character2);
     Assert.That(result,Is.True);
 }