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