Ejemplo n.º 1
0
        public void TestAddPoint_Player1Wins3Points_NoWinner()
        {
            var game = new RegularGame();

            game.AddPoint(0);
            game.AddPoint(0);
            game.AddPoint(0);

            Assert.AreEqual(-1, game.GetWinnerPlayer());
        }
Ejemplo n.º 2
0
        public IGame Build()
        {
            IGame game = new RegularGame();

            foreach (var item in players)
            {
                game.Players.Add(item);
            }

            game.TotalMoney = players.Count * 50;
            return(game);
        }
Ejemplo n.º 3
0
        public void TestAddPoint_Player1ScoresPointWithAdvantage_Player1Wins()
        {
            var game = new RegularGame();

            game.AddPoint(0);
            game.AddPoint(0);
            game.AddPoint(0);

            game.AddPoint(1);
            game.AddPoint(1);
            game.AddPoint(1);

            game.AddPoint(0);
            game.AddPoint(0);

            Assert.AreEqual(0, game.GetWinnerPlayer());
        }
Ejemplo n.º 4
0
        private void GameFactory(Set set)
        {
            if (set.Games.Count == 12)
            {
                Game = new TiebreakGame {
                    Set = set
                }
            }
            ;
            else
            {
                Game = new RegularGame {
                    Set = set
                }
            };
        }

        #endregion
    }
Ejemplo n.º 5
0
        public void TestAddPoint_Player2ComesBackAfterPlayer1Advantage_Player2Wins()
        {
            var game = new RegularGame();

            game.AddPoint(0);
            game.AddPoint(0);
            game.AddPoint(0);

            game.AddPoint(1);
            game.AddPoint(1);
            game.AddPoint(1);

            game.AddPoint(0);

            game.AddPoint(1);
            game.AddPoint(1);
            game.AddPoint(1);

            Assert.AreEqual(1, game.GetWinnerPlayer());
        }