Beispiel #1
0
        public void MSTest_AttackCommand()
        {
            Node     n      = new Node();
            Pack     pack   = new Pack("test", 1);
            Creature victim = pack.members[0];

            victim.HP = 8;
            int     innitalHP = victim.HP;
            Command attCom    = new AttackCommand(victim.id);
//			Assert.IsTrue(attCom.ToString() == "attack " + victim.name);
            Player player = new Player();

            player.location = n;
            pack.location   = n;
            n.packs.Add(pack);
            attCom.ExecuteCommand(player);
            Assert.IsTrue(victim.HP == Math.Max(0, innitalHP - 5));

            while (victim.HP > 0)
            {
                attCom.ExecuteCommand(player);
            }
            Assert.IsFalse(pack.members.Contains(victim));
        }