예제 #1
0
        public void UpFourthRoundWithoutAD()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_1());
            Assert.IsTrue((game.Player_1().Score(0) == 40) && (game.Player_2().Score(0) == 40) && (game.result[0, 0] == 0) && (game.result[1, 0] == 0) && (game.Advantage() == "Name_1"));
        }
예제 #2
0
        public void UpFiveRoundWithAD()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_2());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            Assert.IsTrue((game.Player_1().Score(0) == 0) && (game.Player_2().Score(0) == 0) && (game.Player_1().Score(1) == 1) && (game.Player_2().Score(1) == 0) && (game.result[0, 0] == 1) && (game.result[1, 0] == 0) && (game.Advantage() == "Nothing"));
        }
예제 #3
0
        public void ChangeSides()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            game.ChangeSides();
            Assert.IsTrue((game.LeftSide() == game.Player_2()) && (game.RightSide() == game.Player_1()));
        }
예제 #4
0
        public void PlayersDifferent()
        {
            TennisGame game = new TennisGame("Eman", "Eman");

            Assert.IsTrue(game.Player_1().Name() == "Eman_1");
            Assert.IsTrue(game.Player_2().Name() == "Eman_2");
        }
예제 #5
0
        public void PlayersCorrectly()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            Assert.IsTrue(game.Player_1().Name() == "Name_1");
            Assert.IsTrue(game.Player_2().Name() == "Name_2");
        }
예제 #6
0
        public void UpFourthRoundClear()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            game.UpRound(game.Player_1());
            Assert.IsTrue((game.Player_1().Score(0) == 0) && (game.Player_2().Score(0) == 0) && (game.Player_1().Score(1) == 1) && (game.Player_2().Score(1) == 0) && (game.result[0, 0] == 1) && (game.result[1, 0] == 0));
        }
예제 #7
0
        public void StartRightSide()
        {
            TennisGame game = new TennisGame("Name_1", "Name_2");

            Assert.IsTrue(game.RightSide() == game.Player_2());
        }