public JoiningAGameFullOfPlayers() { _output = new TestOutput(); var app = new ChessApp(_output); app.Handle(new CreateGameAppCommand()); var latestGameName = _output.LatestGameName; var newGame = app.GetGame(latestGameName); app.Handle(new JoinGameAppCommand(latestGameName, "denise", PlayerColour.Black)); app.Handle(new JoinGameAppCommand(latestGameName, "derek", PlayerColour.White)); _existingBlackPlayer = newGame.GetPlayer(PlayerColour.Black); _existingWhitePlayer = newGame.GetPlayer(PlayerColour.White); app.Handle(new JoinGameAppCommand(latestGameName, "gary", PlayerColour.Black)); }
public StartingANewGame() { var output = new TestOutput(); _app = new ChessApp(output); _app.Handle(new CreateGameAppCommand()); _latestGameName = output.LatestGameName; _newGame = _app.GetGame(_latestGameName); }
public static void Main(string[] args) { var app = new ChessApp(new CommandLineOutput()); var interpreter = new StringCommandInterpreter(); while (app.IsRunning) { var input = Console.ReadLine(); var command = interpreter.GetCommand(input); if (command != null) { app.Handle(command); } else { Console.WriteLine("Unknown command '{0}'.", input); } } }