public _MonopolyTest() { //setup our console read and write theConsole = new consoleIntercept(); theConsoleReader = new consoleReader(); Console.SetOut(theConsole); Console.SetIn(theConsoleReader); testGame.setUpProperties(); }
// [Test] public void TestgetInputYN() { theConsoleReader = new consoleReader(); String Question = "Will This Test Pass"; testGame.getInputYN(testPlayer, Question); theConsoleReader.useKey("S"); // theConsole.ClearConsole(); ArrayList T = theConsole.getOutput(); Assert.IsTrue((T[0].ToString() == "That answer cannot be understood. Please answer 'y' or 'n'.")); }
// [Test] public void TestMainChoiceMenu() { theConsoleReader = new consoleReader(); theConsoleReader.useKey("1"); theConsole.ClearConsole(); testGame.displayMainChoiceMenu(); ArrayList T = theConsole.getOutput(); Assert.IsTrue((T[1].ToString() == "2. Start New Game")); theConsole.ClearConsole(); testGame.inputInteger(); Assert.NotNull(testGame); }