Ejemplo n.º 1
0
 public void TestMoveOn_With_Board()
 {
     Ball ball = new Ball(1, 2);
     GameMap board = new GameMap(80, 10, 1, 1, new Point(40, 0), ball);
     ball.MoveAt(4, 4);
     Assert.AreEqual(4, ball.CPoint.X);
     Assert.AreEqual(4, ball.CPoint.Y);
 }
Ejemplo n.º 2
0
        public void TestCanBeMovedOn_With_Board()
        {
            Ball ball = new Ball(1, 2);
            GameMap map = new GameMap(80, 20, 1, 1, new Point(40, 0), ball);

            Assert.IsFalse(ball.CanBeMoveAt(-1, -1));
            Assert.IsTrue(ball.CanBeMoveAt(1, 3));
            Assert.IsTrue(ball.CanBeMoveAt(8, 4));
            Assert.IsFalse(ball.CanBeMoveAt(-1, -2));

            Assert.IsFalse(ball.CanBeMoveAt(9, -1));
            Assert.IsFalse(ball.CanBeMoveAt(-2, -1));
            Assert.IsTrue(ball.CanBeMoveAt(0, 5));
            Assert.IsFalse(ball.CanBeMoveAt(0, -3));
        }
Ejemplo n.º 3
0
 public void TestMoveOn_With_Board_WrongY()
 {
     Ball ball = new Ball(1, 2);
     GameMap board = new GameMap(80, 20, 1, 1, new Point(40, 0), ball);
     ball.MoveAt(2, -3);
 }