コード例 #1
0
        public void ModifiersCanBeAppliedToArmorClass()
        {
            var def = new DefenseStats(
                new AbilityScores(),
                new SizeStats(),
                new Inventory()
                );
            var ac = def.ArmorClass();

            def.ProcessModifier(new MockMod());
            Assert.AreEqual(ac + 1, def.ArmorClass());
        }
コード例 #2
0
        public void EquippedArmorIncreasesYourDefenseAndYourFlatFootedDefenseButNotTouchDefense()
        {
            //TODO: Not sure if inventory is correct, or if inventory items should have modifiers?
            var inventory = new Inventory();
            var def       = new DefenseStats(
                new AbilityScores(),
                new SizeStats(),
                inventory
                );
            var startAC    = def.ArmorClass();
            var startFlat  = def.FlatFootedArmorClass();
            var startTouch = def.TouchArmorClass();

            var armor = new Armor();

            armor.ArmorClass = 10;

            inventory.AddGear(armor);
            inventory.EquipItem(armor);
            Assert.AreEqual(10, def.EquippedArmorBonus());
            Assert.AreEqual(startAC + 10, def.ArmorClass());
            Assert.AreEqual(startFlat + 10, def.FlatFootedArmorClass());
            Assert.AreEqual(startTouch, def.TouchArmorClass());
        }
コード例 #3
0
 public void ACIsBasedOnDexterityAndSize()
 {
     Assert.AreEqual(14, smallStats.ArmorClass());
 }