Example #1
0
        public void TryShootBug()
        {
            Bug      bug = new Bug();
            PlassGun gun = new PlassGun();

            gun.FireAt(bug);

            Assert.IsTrue(bug.IsDead());
            Assert.IsTrue(gun.HasAmmo());
        }
Example #2
0
        public void NUnit_FireMultipleTimes(int fireCount)
        {
            Bug      bug = new Bug();
            PlassGun gun = new PlassGun();

            for (int i = 0; i < fireCount; i++)
            {
                gun.FireAt(bug);
            }

            if (fireCount >= 3)
            {
                Assert.IsFalse(gun.HasAmmo());
            }
            else
            {
                Assert.IsTrue(gun.HasAmmo());
            }
        }
Example #3
0
        public void TryShootDodgingBug()
        {
            Bug      bug = new Bug();
            PlassGun gun = new PlassGun();

            bug.Dodge();
            gun.FireAt(bug);

            bug.Dodge();
            gun.FireAt(bug);

            bug.Dodge();
            gun.FireAt(bug);

            Assert.IsFalse(bug.IsDead());
            Assert.IsFalse(gun.HasAmmo());
        }