Ejemplo n.º 1
0
        public void TestEquipToBody_EquippingArmourThatAThiefCannotUse()
        {
            Dictionary <Dungeons_and_Dragons.Attribute, int> dict = new Dictionary <Dungeons_and_Dragons.Attribute, int>();

            dict.Add(Dungeons_and_Dragons.Attribute.Strength, 15);
            dict.Add(Dungeons_and_Dragons.Attribute.Dexterity, 10);
            dict.Add(Dungeons_and_Dragons.Attribute.Intelligence, 3);
            dict.Add(Dungeons_and_Dragons.Attribute.Wisdom, 8);
            dict.Add(Dungeons_and_Dragons.Attribute.Constitution, 17);
            dict.Add(Dungeons_and_Dragons.Attribute.Charisma, 9);
            int   xp    = 0;
            int   hp    = 3;
            Thief thief = new Thief("Stickie", Race.Elf, dict, hp, xp);

            ChainMail chainArmour = new ChainMail();

            bool valArmourEquipped = thief.EquipToBody(chainArmour);

            Assert.IsFalse(valArmourEquipped, "TEST1: It is expected that the Armour Cannot be equipped");
            Assert.IsNull(thief.equippedToBody, "TEST2: It was expected that the armour is NOT equipped");
        }
Ejemplo n.º 2
0
        public void TestEquipToBody_TryingToEquipItemThatEquipsToAHandToTheBody()
        {
            Dictionary <Dungeons_and_Dragons.Attribute, int> dict = new Dictionary <Dungeons_and_Dragons.Attribute, int>();

            dict.Add(Dungeons_and_Dragons.Attribute.Strength, 15);
            dict.Add(Dungeons_and_Dragons.Attribute.Dexterity, 10);
            dict.Add(Dungeons_and_Dragons.Attribute.Intelligence, 3);
            dict.Add(Dungeons_and_Dragons.Attribute.Wisdom, 8);
            dict.Add(Dungeons_and_Dragons.Attribute.Constitution, 17);
            dict.Add(Dungeons_and_Dragons.Attribute.Charisma, 9);
            int   xp    = 0;
            int   hp    = 3;
            Thief thief = new Thief("Stickie", Race.Elf, dict, hp, xp);

            Sword sword = new Sword();

            bool valSwordEquipped = thief.EquipToBody(sword);

            Assert.IsFalse(valSwordEquipped, "TEST1: It is expected that the a thief cannot equip a shield");
            Assert.IsNull(thief.equippedToBody, "TEST2: It was expected that the shield is NOT equipped");
        }
Ejemplo n.º 3
0
        public void TestEquipToBody_EquippingArmourThatAThiefCanUse()
        {
            Dictionary <Dungeons_and_Dragons.Attribute, int> dict = new Dictionary <Dungeons_and_Dragons.Attribute, int>();

            dict.Add(Dungeons_and_Dragons.Attribute.Strength, 15);
            dict.Add(Dungeons_and_Dragons.Attribute.Dexterity, 10);
            dict.Add(Dungeons_and_Dragons.Attribute.Intelligence, 3);
            dict.Add(Dungeons_and_Dragons.Attribute.Wisdom, 8);
            dict.Add(Dungeons_and_Dragons.Attribute.Constitution, 17);
            dict.Add(Dungeons_and_Dragons.Attribute.Charisma, 9);
            int   xp    = 0;
            int   hp    = 3;
            Thief thief = new Thief("Stickie", Race.Elf, dict, hp, xp);

            LeatherArmour leatherArmour = new LeatherArmour();

            bool valArmourEquipped = thief.EquipToBody(leatherArmour);

            Assert.IsTrue(valArmourEquipped, "TEST1: It is expected that the Armour will be equipped");
            Assert.AreEqual(leatherArmour, thief.equippedToBody, "TEST2: It was expected that the leather armour is now equipped");
        }