示例#1
0
        public void CheckWin_ForPlayer2Wins_ReturnTrue()
        {
            //Arrange
            Project_Pong.Form1.PongGame Test = new Project_Pong.Form1.PongGame();

            //Act
            bool Player2Won = Test.CheckWin(8, 11);

            //Assert
            Assert.IsTrue(Player2Won);
        }
示例#2
0
        public void Restart_ForPlayer2Score_ChecksXSpeed()
        {
            //Arrange
            Project_Pong.Form1.PongGame Test = new Project_Pong.Form1.PongGame();

            //Act
            Test.Restart(2);
            int XSpeed = Test.Xspeed;

            //Assert
            Assert.AreEqual(XSpeed, -1);
        }
示例#3
0
        public void CheckScore_ForPlayer2ScoreChanged_ReturnTrue()
        {
            //Arrange
            Rectangle Ball = new Rectangle(0, 115, 16, 16);

            Project_Pong.Form1.PongGame Test = new Project_Pong.Form1.PongGame(Ball);

            //Act
            bool ScoreChanged = Test.CheckScore(1, 1);

            //Assert
            Assert.IsTrue(ScoreChanged);
        }