Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public bool isWin()
 {
     return(wordToGuess.isWin());
 }