예제 #1
0
        public void SolveSecondPuzzle()
        {
            var sut = new RecursiveCombat(PuzzleData.PUZZLE_DATA);

            sut.Play();
            sut.CalculatePointsForWinner();
            Assert.Equal(32665, sut.WinnerPoints);
        }
예제 #2
0
        public void PlayRecursiveGameCorrectly()
        {
            var sut = new RecursiveCombat(PuzzleData.SAMPLE_DATA);

            sut.Play();
            sut.CalculatePointsForWinner();
            Assert.Equal(291, sut.WinnerPoints);
        }
예제 #3
0
        public void ReturnPoints_WhenCalculatingWinnerPointsAfterTheRecursiveGame()
        {
            var sut = new RecursiveCombat(PuzzleData.SAMPLE_DATA);

            sut.PlayTurns(17);
            sut.CalculatePointsForWinner();
            Assert.Equal(291, sut.WinnerPoints);
        }
예제 #4
0
        public void PreventInfiniteRecursion()
        {
            const string decks = @"Player 1:
43
19

Player 2:
2
29
14";

            var sut = new RecursiveCombat(decks);

            sut.Play();
            sut.CalculatePointsForWinner();
            Assert.Equal(105, sut.WinnerPoints);
        }