示例#1
0
        public void CheckInvincibilityPerk()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            frm.InvincibilityPerk();
            Assert.AreEqual(true, frm.perkUse);
            Assert.AreEqual(true, frm.invble);
            frm.Dispose();
        }
示例#2
0
        public void CheckIfInvaderIsDestroyed()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            frm.DestroyInvader(frm.inv1);
            Assert.AreEqual(false, frm.inv1.Visible);
            Assert.AreEqual(false, frm.picTiroJog.Visible);
            Assert.AreEqual(50, frm.score);
            Assert.AreEqual(true, frm.tirodisponivel);
            frm.Dispose();
        }
示例#3
0
        public void CheckSpeedPerk()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            int speed = frm.canonMovement;

            frm.SpeedPerk();
            Assert.AreEqual(true, frm.perkUse);
            Assert.AreEqual(speed + 10, frm.canonMovement);
            frm.Dispose();
        }
示例#4
0
        public void CheckIfGameOver()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            Assert.AreEqual(false, frm.btnNovoJogo.Enabled);
            Assert.AreEqual(true, frm.gamestart);
            frm.GameOver();
            Assert.AreEqual(true, frm.btnNovoJogo.Enabled);
            Assert.AreEqual(false, frm.gamestart);
            frm.Dispose();
        }
示例#5
0
        public void CheckIfValuesInitialized()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            Assert.AreEqual(12, frm.inv1.Left);
            Assert.AreEqual(16, frm.inv2.Top);
            Assert.AreEqual(0, frm.ciclos);
            Assert.AreEqual(0, frm.aproximado);
            Assert.AreEqual(0, frm.score);
            Assert.AreEqual(130, frm.inv15.Top);
            Assert.AreEqual(404, frm.inv18.Left);
            frm.Dispose();
        }
示例#6
0
        public void CheckIfCanonShoots()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            frm.CanonShoot();
            bool visible = frm.picTiroJog.Visible;
            int  x       = frm.picJog.Top;

            Assert.AreEqual(373, frm.picTiroJog.Left);
            Assert.AreEqual(x - 25, frm.picTiroJog.Top);
            Assert.AreEqual(false, frm.tirodisponivel);
            frm.Dispose();
        }
示例#7
0
        public void CheckCanonMovement()
        {
            frmInvaders frm = new frmInvaders();

            frm.InitializeValues();
            int pressLeftArrowKey = 97;

            frm.CanonMovement(pressLeftArrowKey);
            Assert.AreEqual(315, frm.picJog.Left);
            int pressRightArrowKey = 100;

            frm.CanonMovement(pressRightArrowKey);
            Assert.AreEqual(355, frm.picJog.Left);
            frm.Dispose();
        }