Example #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);
        }
Example #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);
        }
Example #4
0
 public bool isLetterInWord()
 {
     return(wordToGuess.isLetterInWord(guess.getMostRecentGuess()));
 }