Exemple #1
0
        public void TryShootDodgingBug()
        {
            bug.Dodge();
            gun.FireAt(bug);


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

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

            Assert.IsFalse(bug.IsDead());
            Assert.IsFalse(gun.HasAmmo());
        }
Exemple #2
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());
        }
Exemple #3
0
        public void TestBugDodges(bool didDodge, bool shouldBeDead)
        {
            Bug bug = new Bug ();
            Raygun gun = new Raygun ();

            if (didDodge) {
                bug.Dodge ();
            }

            gun.FireAt (bug);

            if (shouldBeDead) {
                Assert.True (bug.IsDead ());
            } else {
                Assert.False (bug.IsDead ());
            }
        }
Exemple #4
0
        public void NUnit_TestBugDodges(bool didDodge, bool shouldBeDead)
        {
            Bug      bug = new Bug();
            PlassGun gun = new PlassGun();

            if (didDodge)
            {
                bug.Dodge();
            }

            gun.FireAt(bug);

            if (shouldBeDead)
            {
                Assert.IsTrue(bug.IsDead());
            }
            else
            {
                Assert.IsFalse(bug.IsDead());
            }
        }