public void GetWinnerPointsShouldReturnFirstPlayerAsWinnerWithThreePoints(
     int firstPlayerPoints,
     int secondPlayerPoints,
     PlayerPosition gameClosedBy,
     PlayerPosition noTricksPlayer)
 {
     IRoundWinnerPointsLogic roundWinnerPointsLogic = new RoundWinnerPointsPointsLogic();
     var result = roundWinnerPointsLogic.GetWinnerPoints(
         firstPlayerPoints,
         secondPlayerPoints,
         gameClosedBy,
         noTricksPlayer,
         GameRulesProvider.Santase);
     Assert.AreEqual(PlayerPosition.FirstPlayer, result.Winner);
     Assert.AreEqual(3, result.Points);
 }
예제 #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;
            }
        }