Exemplo n.º 1
0
        public void Should__IndicateWhatIsRight__When__GuessIsPartiallyCorrect(string answer, string guess, string expectedResult)
        {
            // arrange
            Combination combination = new Combination(answer, 1, 6);

            // act
            GuessResult result = combination.Try(guess);

            // assert
            result.WasRight.Should().BeFalse();
            result.ToString().Should().Be(expectedResult);
        }
Exemplo n.º 2
0
        public void Should__IndicateSuccess__When__GuessMatchesAnswer()
        {
            // arrange
            Combination combination =
                new CombinationBuilder()
                .WithLength(4)
                .UsingDigitsBetween(1, 6);

            string guess = combination.GetAnswer();

            // act
            GuessResult result = combination.Try(guess);

            // assert
            result.WasRight.Should().BeTrue();
            result.ToString().Should().Be("++++");
        }