public void OutOfLives_ZeroLives_ReturnsTrue() { HangmanMain hm = MakeHangman(); int lives = 0; Assert.IsTrue(hm.OutOfLives(lives)); }
public void OutOfLives_PositiveLives_ReturnsFalse() { HangmanMain hm = MakeHangman(); int lives = 3; Assert.IsFalse(hm.OutOfLives(lives)); }
public void RemoveLife_InCorrectGuess_ReturnsTrue() { HangmanMain hm = MakeHangman(); string word = "abc"; string guess = "d"; Assert.IsTrue(hm.RemoveLife(word, guess)); }
public void ValidInput_DoubleCharacter_ReturnsFalse() { HangmanMain hm = MakeHangman(); string guess = "ab"; Assert.IsFalse(hm.ValidInput(guess)); }
public void ValidInput_SingleCharacter_ReturnsTrue() { HangmanMain hm = MakeHangman(); string guess = "a"; Assert.IsTrue(hm.ValidInput(guess)); }
public void SelectRandomWord_ReturnsString() { HangmanMain hm = MakeHangman(); List <string> words = new List <string> { "big", "car", "lorry" }; Assert.IsNotNull(hm.SelectRandomWord(words)); }
public void GenerateWordString_IncorrectGuesses_ReturnsCorrectFormat() { HangmanMain hm = MakeHangman(); string word = "abc"; List <string> guesses = new List <string> { "d", "a" }; Assert.AreEqual("a__", hm.GenerateWordString(word, guesses)); }
public void FormatGuessesForPrinting_ReturnsCorrectString() { HangmanMain hm = MakeHangman(); List <string> guesses = new List <string> { "a", "b", "c" }; Assert.AreEqual("abc", hm.FormatGuessesForPrinting(guesses)); }
public void AddStringToList_IncreasesListItems() { HangmanMain hm = MakeHangman(); List <string> guesses = new List <string> { }; string guess = "a"; guesses = hm.AddStringToList(guesses, guess); Assert.AreEqual(1, guesses.Count); }
public void DuplicateGuess_Duplicate_ReturnsTrue() { HangmanMain hm = MakeHangman(); List <string> guesses = new List <string> { "a", "b" }; string guess = "a"; Assert.IsTrue(hm.DuplicateGuess(guesses, guess)); }
public void WordGuessed_NotAllCorrect_ReturnsFalse() { HangmanMain hm = MakeHangman(); string word = "abc"; List <string> guesses = new List <string> { "a", "b", "d" }; Assert.IsFalse(hm.WordGuessed(word, guesses)); }
public void RoundNotFinished_WordNotGuessedAndLivesZero_ReturnsFalse() { HangmanMain hm = MakeHangman(); int lives = 0; string word = "abc"; List <string> guesses = new List <string> { "a", "b" }; Assert.IsFalse(hm.RoundNotFinished(word, guesses, lives)); }