Esempio n. 1
0
        public void TestCompare(string guessString, string answerString, int expectedCorrectInCorrectPlace, int expectedCorreceInTheWrongPlace, bool expectedUserIsCorrect)
        {
            //Arrange
            var guess  = new Combination(guessString);
            var answer = new Combination(answerString);

            //Act
            guess.CompareToAnswer(answer, out int correctDigitInCorrectPlace, out int correctDigitsInTheWrongPlace, out bool userIsCorrect);

            //Assert
            Assert.AreEqual(expectedCorrectInCorrectPlace, correctDigitInCorrectPlace);
            Assert.AreEqual(expectedCorreceInTheWrongPlace, correctDigitsInTheWrongPlace);
            Assert.AreEqual(expectedUserIsCorrect, userIsCorrect);
        }