Ejemplo n.º 1
0
 public void Brick_TestGhost()
 {
     //Similar to Brick_TestCharged()
     Ball b = new RegularBall(PointF.Empty);
     b.moveVector = new SizeF(0, -1.0f);
     Brick br = new GhostBrick(PointF.Empty);
     br.OnHit(ref b);
     Assert.AreEqual(new SizeF(0, -1.0f), b.moveVector);
     Assert.AreEqual(typeof(GhostBall), b.GetType());
 }
Ejemplo n.º 2
0
        public void Brick_TestCharge()
        {
            //Create a new Ball object
            Ball b = new RegularBall(PointF.Empty);

            //Set the move vector
            b.moveVector = new SizeF(1, -1.0f);

            //Create a new ChargedBrick object
            Brick br = new ChargedBrick(PointF.Empty);

            //Hit the brick
            br.OnHit(ref b);

            //Ball does not change direction
            Assert.AreEqual(new SizeF(1, -1.0f), b.moveVector);

            //Ball changes type to 'ChargedBall'
            Assert.AreEqual(typeof(ChargedBall), b.GetType());
        }