Ejemplo n.º 1
0
        public void ReturnMixedOutcomeGivenSomeCorrectAndSomeIncorrect(int[] guess, int[] answer, string expected)
        {
            var gameRound = new GameRound(answer);
            var outcome   = gameRound.CheckAnswer(guess);

            outcome.ShouldBe(expected);
        }
Ejemplo n.º 2
0
        public void ReturnAllMinusGivenAllCorrectNumbersInWrongPlaces(int[] guess, int[] answer)
        {
            var gameRound = new GameRound(answer);
            var outcome   = gameRound.CheckAnswer(guess);
            var expected  = string.Concat(Enumerable.Repeat(GameAnswers.CorrectNumberWrongPlace, 4));

            outcome.ShouldBe(expected);
        }
Ejemplo n.º 3
0
        public void ReturnCorrectOutcomeGivenCorrectGuess()
        {
            int[] answer = new int[4] {
                1, 2, 3, 4
            };
            int[] guess = answer;

            var gameRound = new GameRound(answer);
            var outcome   = gameRound.CheckAnswer(guess);

            outcome.ShouldBe(GameAnswers.CorrectGuess);
        }
Ejemplo n.º 4
0
        public void ReturnAllBlankOutcomeGivenAllIncorrectGuesses()
        {
            int[] answer = new int[4] {
                1, 2, 3, 4
            };
            int[] guess = new int[4] {
                5, 6, 5, 6
            };

            var gameRound = new GameRound(answer);
            var outcome   = gameRound.CheckAnswer(guess);
            var expected  = string.Concat(Enumerable.Repeat(GameAnswers.WrongNumber, 4));

            outcome.ShouldBe(expected);
        }