public void CheckWordPrintViewAfterProcessingTheHelpCommandTest() { Player player = Player.Instance; player.Name = "Milena"; player.AttemptsToGuess = 0; var checkManager = new CheckManager(player); IWord word = new ProxyWord("test"); checkManager.DefineCommands(word); checkManager.CheckCommand("Help", word); Assert.AreEqual(word.PrintView, "t---"); }
public void IsTheHasHelpUsedStateFalseWhenUsingHelpOptionTest() { Player player = Player.Instance; player.Name = "Milena"; player.AttemptsToGuess = 0; var checkManager = new CheckManager(player); IWord word = new ProxyWord("test"); checkManager.DefineCommands(word); checkManager.HasHelpUsed = true; using (var writer = new StringWriter()) { Console.SetOut(writer); checkManager.CheckCommand("Help", word); writer.Flush(); string result = writer.GetStringBuilder().ToString(); string expected = "You have already used your help option!\r\n" + "The secret word is:----\r\n"; Assert.AreEqual(expected, result); } }
public void IsTheHasHelpUsedStateTrueWhenUsingHelpOptionTest() { Player player = Player.Instance; player.Name = "Milena"; player.AttemptsToGuess = 0; var checkManager = new CheckManager(player); IWord word = new ProxyWord("test"); checkManager.DefineCommands(word); checkManager.CheckCommand("Help", word); Assert.IsTrue(checkManager.HasHelpUsed); }