public void GetWinnerPointsShouldReturnSecondPlayerAsWinnerWithOnePoint(
            int firstPlayerPoints,
            int secondPlayerPoints,
            PlayerPosition gameClosedBy,
            PlayerPosition noTricksPlayer)
        {
            IRoundWinnerPointsLogic roundWinnerPointsLogic = new RoundWinnerPointsPointsLogic();
            var result = roundWinnerPointsLogic.GetWinnerPoints(
                firstPlayerPoints,
                secondPlayerPoints,
                gameClosedBy,
                noTricksPlayer,
                GameRulesProvider.Santase);

            Assert.Equal(PlayerPosition.SecondPlayer, result.Winner);
            Assert.Equal(1, result.Points);
        }
Esempio n. 2
0
        private void UpdatePoints(RoundResult roundResult)
        {
            IRoundWinnerPointsLogic roundWinnerPointsPointsLogic = new RoundWinnerPointsPointsLogic();
            var roundWinnerPoints = roundWinnerPointsPointsLogic.GetWinnerPoints(
                roundResult.FirstPlayer.RoundPoints,
                roundResult.SecondPlayer.RoundPoints,
                roundResult.GameClosedBy,
                roundResult.NoTricksPlayer,
                this.gameRules);

            switch (roundWinnerPoints.Winner)
            {
            case PlayerPosition.FirstPlayer:
                this.FirstPlayerTotalPoints += roundWinnerPoints.Points;
                this.firstToPlay             = PlayerPosition.SecondPlayer;
                break;

            case PlayerPosition.SecondPlayer:
                this.SecondPlayerTotalPoints += roundWinnerPoints.Points;
                this.firstToPlay              = PlayerPosition.FirstPlayer;
                break;
            }
        }