Exemplo n.º 1
0
        public void TestCreatureLocation()
        {
            Node         n = new Node();
            MockCreature c = new MockCreature(null);

            c.Location = n;
            Assert.AreEqual(n, c.Location);
        }
Exemplo n.º 2
0
        public void TestPackAttack()
        {
            Pack         p = new Pack(3, new Node(0, 0), 1, 1);
            MockCreature c = new MockCreature(new Node(0, 0), 5);

            p.Attack(c);
            Assert.AreEqual(2, c.HitPoints);
        }
Exemplo n.º 3
0
        public void TestPlayerAttack()
        {
            MockCreature c = new MockCreature();
            Player       p = new Player(null, 10, 5, null, null);

            p.Attack(c);

            Assert.AreEqual(1, p.KillPoints);
        }
Exemplo n.º 4
0
        public void TestCreatureHitPoints()
        {
            MockCreature m        = new MockCreature(null);
            const float  TARGETHP = 50f;

            m.HitPoints = TARGETHP;
            Assert.AreEqual(TARGETHP, m.HitPoints);

            m.HitPoints = 0;
            Assert.AreEqual(true, m.IsDead());
        }
Exemplo n.º 5
0
        public void TestCreatureConstructor()
        {
            float        creatureHealth = 10;
            Node         node           = new Node(0, 0, 0);
            float        attackRating   = 2;
            MockCreature m = new MockCreature(node, creatureHealth, attackRating);

            Assert.AreEqual(node, m.Location);
            Assert.AreEqual(creatureHealth, m.HitPoints);
            Assert.AreEqual(attackRating, m.AttackRating);
        }
Exemplo n.º 6
0
        public void TestCreatureAttack()
        {
            MockCreature m1 = new MockCreature(null);
            MockCreature m2 = new MockCreature(null);

            float startHealth  = m2.HitPoints;
            float targetHealth = startHealth - m1.AttackRating;

            m1.Attack(m2);

            Assert.AreEqual(targetHealth, m2.HitPoints);
        }
Exemplo n.º 7
0
        public void TestCreatureMove()
        {
            Node         oldNode = new Node(0, 0, 0);
            MockCreature m       = new MockCreature(oldNode);

            Node newNode = new Node(0, 0, 0);

            m.Move(newNode);

            Assert.AreNotEqual(oldNode, m.Location);
            Assert.AreEqual(newNode, m.Location);
        }