public void ResultMessage_Tie() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act /* * X | X | O * O | O | X * X | X | O */ //Act game.PlaceMark(0, 0); game.PlaceMark(1, 1); game.PlaceMark(0, 1); game.PlaceMark(2, 2); game.PlaceMark(1, 2); game.PlaceMark(0, 2); game.PlaceMark(2, 0); game.PlaceMark(1, 0); game.PlaceMark(2, 1); string result = console.Result(); //Assert Assert.Equal(MessageEnums.Messages.Result.GetDescription() + Char.MinValue, result); }
static void Main(string[] args) { BaseGame game = new GameEngine.TicTacToe(3, 3); Display console = new Display(game); Console.WriteLine(console.Title()); Console.WriteLine(console.GameStartMessage()); int[] coordinates = new int[2]; while (!game.GameIsOver()) { console.PrintBoard(); Console.WriteLine(console.GatherInputMessage()); coordinates = GatherInput(); game.PlaceMark(coordinates[0], coordinates[1]); } Console.WriteLine(console.GameEndMessage()); console.PrintBoard(); if (game.IsWon()) { Console.WriteLine(console.Result()); } Console.ReadLine(); }
public void GatherInputMessage() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act string result = console.GatherInputMessage(); //Assert Assert.Equal(MessageEnums.Messages.GatherInput.GetDescription(), result); }
public void ResultMessage() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act string result = console.Result(); //Assert Assert.Equal(MessageEnums.Messages.Result.GetDescription() + Char.MinValue, result); }
public void Winner_MinValue() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act char result = console.Winner(); //Assert Assert.Equal(char.MinValue, result); }
public void ResultMessage_X() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act game.PlaceMark(0, 0); game.PlaceMark(2, 2); game.PlaceMark(0, 1); game.PlaceMark(1, 1); game.PlaceMark(0, 2); string result = console.Result(); //Assert Assert.Equal(MessageEnums.Messages.Result.GetDescription() + "X", result); }
public void Winner_XWins() { //Arrange BaseGame game = new GameEngine.TicTacToe(3, 3); IDisplay console = new Display(game); //Act game.PlaceMark(0, 0); game.PlaceMark(2, 2); game.PlaceMark(0, 1); game.PlaceMark(1, 1); game.PlaceMark(0, 2); char result = console.Winner(); //Assert Assert.Equal('X', result); }