Exemple #1
0
        public void DamageCalled_WithInvalidValues_DamageMethodDoesNotThrow([Values(110, -10)] int damageValue)
        {
            var bee = new BeeBase(70);

            Assert.DoesNotThrow(() => { bee.Damage(damageValue); });
            Assert.False(bee.IsDead);
        }
Exemple #2
0
        public void BeeHealthThreshold_SetCorrectlyWithinConstructor()
        {
            var healthThreshold = 42;
            var bee             = new BeeBase(healthThreshold);

            Assert.AreEqual(healthThreshold, bee.HealthThreshold);
        }
Exemple #3
0
        public void DamageCalled_IfNotDead_BeeTakesCorrectDamage()
        {
            var bee = new BeeBase(70);

            bee.Damage(25);

            Assert.AreEqual((float)75, bee.Health);
        }
Exemple #4
0
        public void BeeHealthIsBelowThreshold_BeeIsDead()
        {
            var bee = new BeeBase(100);

            bee.Damage(1);

            Assert.True(bee.IsDead);
        }
Exemple #5
0
        public void DamageCalled_IfDead_DamageMethodDoesNotThrow()
        {
            var bee = new BeeBase(100);

            bee.Damage(1);

            Assert.True(bee.IsDead);
            Assert.DoesNotThrow(() => { bee.Damage(30); });
        }
Exemple #6
0
        public void DamageCalled_IfDead_BeeTakesNoDamage()
        {
            var bee = new BeeBase(90);

            bee.Damage(11);
            bee.Damage(40);

            Assert.AreEqual((float)89, bee.Health);
        }
Exemple #7
0
    public void GenerateFestBeeSwarm(int beeNumber)
    {
        Transform    swarmExit = m_SwarmExits[Random.Range(0, m_SwarmExits.Count)];
        FestBeeSwarm swarm     = Instantiate(m_BeeSwarmPrefab, swarmExit.position, Quaternion.identity);

        m_festbeeSwarmList.Add(swarm);

        for (int i = 0; i < beeNumber; i++)
        {
            BeeBase bee = Instantiate(m_BeePrefab, swarm.transform.position, Quaternion.identity);
            swarm.AddSwarmObject(bee);
        }
    }
Exemple #8
0
        public void BeeHealth_StartsAt100()
        {
            var bee = new BeeBase(70);

            Assert.AreEqual(100, bee.Health);
        }
Exemple #9
0
        public void BeeHealthIsAboveThreshold_BeeIsNotDead()
        {
            var bee = new BeeBase(70);

            Assert.False(bee.IsDead);
        }