Beispiel #1
0
        public void ComputerConstructorTest()
        {
            // arrange
            ComputerPad computerPad = new ComputerPad(50);

            // act
            int padPosition = 50;
            int padWidth    = 10;
            int padSpeed    = 10;
            int difficulty  = 3;


            // assert
            Assert.AreEqual(computerPad.PadPosition, padPosition);
            Assert.AreEqual(computerPad.Width, padWidth);
            Assert.AreEqual(computerPad.PadSpeed, padSpeed);
            Assert.AreEqual(computerPad.Difficulty, difficulty);
        }
Beispiel #2
0
        public void ConstructorTest()
        {
            // arrange
            Game game = new Game(400, 820);

            // act
            Pad         playerPad      = new Pad(180);
            ComputerPad computerPad    = new ComputerPad(180);
            Ball        ball           = new Ball((820 / 2 - 15), (400 / 2 - 15));
            byte        playerPoints   = 0;
            byte        computerPoints = 0;
            bool        gameActive     = false;

            // assert
            Assert.AreEqual(game.PlayerPadPosition, playerPad.PadPosition);
            Assert.AreEqual(game.PlayerPadWidth, playerPad.Width);
            Assert.AreEqual(game.ComputerPadPosition, computerPad.PadPosition);
            Assert.AreEqual(game.ComputerPadWidth, computerPad.Width);
            Assert.AreEqual(game.BallPositionX, ball.BallPositionX);
            Assert.AreEqual(game.BallPositionY, ball.BallPositionY);
            Assert.AreEqual(game.PlayerPoints, playerPoints);
            Assert.AreEqual(game.ComputerPoints, computerPoints);
            Assert.AreEqual(game.GameActive, gameActive);
        }