コード例 #1
0
        public void DamageCalled_IfDead_BeeTakesNoDamage()
        {
            var bee = new BeeBase(90);

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

            Assert.AreEqual((float)89, bee.Health);
        }
コード例 #2
0
        public void DamageCalled_IfDead_DamageMethodDoesNotThrow()
        {
            var bee = new BeeBase(100);

            bee.Damage(1);

            Assert.True(bee.IsDead);
            Assert.DoesNotThrow(() => { bee.Damage(30); });
        }
コード例 #3
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);
        }
コード例 #4
0
        public void DamageCalled_IfNotDead_BeeTakesCorrectDamage()
        {
            var bee = new BeeBase(70);

            bee.Damage(25);

            Assert.AreEqual((float)75, bee.Health);
        }
コード例 #5
0
        public void BeeHealthIsBelowThreshold_BeeIsDead()
        {
            var bee = new BeeBase(100);

            bee.Damage(1);

            Assert.True(bee.IsDead);
        }