public void Run() { var input = ""; var sb = new StringBuilder(); while ((input = readerWriter.ReadLine().Trim()) != "Shutdown") { var commandResult = this.commandInterpreter.ProcessCommand(input.Split()); sb.AppendLine(commandResult); } var lastCommand = this.commandInterpreter.ProcessCommand(input.Split()); sb.Append(lastCommand); readerWriter.WriteLine(sb.ToString()); }