public void TestHp()
        {
            int           damage = 10, hp = 100;
            BasicCreature creature = new BasicCreature(null, null, null, damage, hp, null);

            int takenDamage = 50;

            Assert.AreEqual(creature.ReciveDamage(takenDamage), (hp - takenDamage));
        }
        public void TestDead3()
        {
            int       damage = 10, hp = 100;
            ICreature creature = new BasicCreature(null, null, null, damage, hp, null);

            int takenDamage = 120;

            creature.ReciveDamage(takenDamage);

            Assert.IsTrue(creature.isDead());
        }
        public void TestHp()
        {
            int           damage = 10, hp = 100;
            Graph         graph            = new Graph(10, 10);
            Node          startDestinaton  = graph.getNode(1, 1);
            Node          finalDestination = graph.getNode(5, 5);
            BasicCreature creature         = new BasicCreature(startDestinaton, finalDestination, graph, damage, hp, null);

            int takenDamage = 50;

            Assert.AreEqual(creature.ReciveDamage(takenDamage), (hp - takenDamage));
        }
        public void TestMoovingChangeToDying()
        {
            int       damage = 10, hp = 100;
            ICreature creature = new BasicCreature(null, null, null, damage, hp, null);
            Status    mooving  = creature.getMoovnig();
            Status    dying    = creature.getDying();

            int takenDamage = 100;

            creature.ReciveDamage(takenDamage);

            Assert.AreEqual(mooving.changeStatus(), dying);
        }
        public void TestDead3()
        {
            int       damage = 10, hp = 100;
            Graph     graph            = new Graph(10, 10);
            Node      startDestinaton  = graph.getNode(1, 1);
            Node      finalDestination = graph.getNode(5, 5);
            ICreature creature         = new BasicCreature(startDestinaton, finalDestination, graph, damage, hp, null);

            int takenDamage = 120;

            creature.ReciveDamage(takenDamage);

            Assert.IsTrue(creature.isDead());
        }
        public void TestHp2()
        {
            int           damage = 10, hp = 100;
            BasicCreature creature = new BasicCreature(null, null, null, damage, hp, null);

            try
            {
                int takenDamage = -50;
                creature.ReciveDamage(takenDamage);
            }
            catch (ArgumentOutOfRangeException e)
            {
                StringAssert.Contains(e.Message, BasicCreature.NEGATIVE_DAMAGE);
            }
        }
Beispiel #7
0
        public void TestMoovingChangeToDying()
        {
            int       damage = 10, hp = 100;
            Graph     graph            = new Graph(10, 10);
            Node      startDestinaton  = graph.getNode(1, 1);
            Node      finalDestination = graph.getNode(5, 5);
            ICreature creature         = new BasicCreature(startDestinaton, finalDestination, graph, damage, hp, null);
            Status    mooving          = creature.getMoovnig();
            Status    dying            = creature.getDying();

            int takenDamage = 100;

            creature.ReciveDamage(takenDamage);

            Assert.AreEqual(mooving.changeStatus(), dying);
        }
        public void TestHp2()
        {
            int           damage = 10, hp = 100;
            Graph         graph            = new Graph(10, 10);
            Node          startDestinaton  = graph.getNode(1, 1);
            Node          finalDestination = graph.getNode(5, 5);
            BasicCreature creature         = new BasicCreature(startDestinaton, finalDestination, graph, damage, hp, null);

            try
            {
                int takenDamage = -50;
                creature.ReciveDamage(takenDamage);
            }
            catch (ArgumentOutOfRangeException e)
            {
                StringAssert.Contains(e.Message, BasicCreature.NEGATIVE_DAMAGE);
            }
        }