public void isWinCorrectForWin() { // Arrange WordToGuess wordToGuess = new WordToGuess(); const string THE_WORD = "dakota"; wordToGuess.setWord(THE_WORD); Guess guess = new Guess(); string guessedLetter = "d"; guess.guessedLetter(guessedLetter, wordToGuess); string ignore = wordToGuess.getGuessesSoFar(guessedLetter); guessedLetter = "a"; guess.guessedLetter(guessedLetter, wordToGuess); ignore = wordToGuess.getGuessesSoFar(guessedLetter); guessedLetter = "k"; guess.guessedLetter(guessedLetter, wordToGuess); ignore = wordToGuess.getGuessesSoFar(guessedLetter); guessedLetter = "o"; guess.guessedLetter(guessedLetter, wordToGuess); ignore = wordToGuess.getGuessesSoFar(guessedLetter); guessedLetter = "t"; guess.guessedLetter(guessedLetter, wordToGuess); ignore = wordToGuess.getGuessesSoFar(guessedLetter); // Act bool actualIsWin = wordToGuess.isWin(); // Assert Assert.IsTrue(actualIsWin); }
public void isWinCorrectForLoss() { // Arrange WordToGuess wordToGuess = new WordToGuess(); const string THE_WORD = "jellybean"; wordToGuess.setWord(THE_WORD); Guess guess = new Guess(); string guessedLetter = "z"; guess.guessedLetter(guessedLetter, wordToGuess); // Act bool actualIsWin = wordToGuess.isWin(); // Assert Assert.IsFalse(actualIsWin); }
public bool isWin() { return(wordToGuess.isWin()); }