示例#1
0
        public void guessedLetter(string letter, WordToGuess wordToGuess)
        {
            mostRecentLetter = letter;

            if (!wordToGuess.isLetterInWord(letter))
            {
                wrongGuesses++;
            }
        }
        public void isLetterInWordYes()
        {
            // Arrange
            WordToGuess  wordToGuess = new WordToGuess();
            const string THE_WORD    = "dakota";

            wordToGuess.setWord(THE_WORD);

            // Act
            const string LETTER = "a";
            bool         actualIsLetterInWord = wordToGuess.isLetterInWord(LETTER);

            // Assert
            Assert.IsTrue(actualIsLetterInWord);
        }
示例#3
0
        public void isLetterInWordNo()
        {
            // Arrange
            WordToGuess  wordToGuess = new WordToGuess();
            const string THE_WORD    = "jellybean";

            wordToGuess.setWord(THE_WORD);

            // Act
            const string LETTER = "z";
            bool         actualIsLetterInWord = wordToGuess.isLetterInWord(LETTER);

            // Assert
            Assert.IsFalse(actualIsLetterInWord);
        }
示例#4
0
 public bool isLetterInWord()
 {
     return(wordToGuess.isLetterInWord(guess.getMostRecentGuess()));
 }