private string ExecuteCommand(IInteractiveWindowCommand cmd, string args) { _window.ClearScreen(); var execute = cmd.Execute(_window, args); execute.Wait(); Assert.IsTrue(execute.Result.IsSuccessful); return(_window.Output.TrimEnd()); }
private async Task <ExecutionResult> ExecuteCommandAsync(IInteractiveWindowCommand command, string arguments) { try { return(await command.Execute(_window, arguments).ConfigureAwait(false)); } catch (Exception e) { _window.ErrorOutputWriter.WriteLine($"Command '{command.Names.First()}' failed: {e.Message}"); return(ExecutionResult.Failure); } }
private async Task<ExecutionResult> ExecuteCommandAsync(IInteractiveWindowCommand command, string arguments) { try { return await command.Execute(_window, arguments).ConfigureAwait(false); } catch (Exception e) { _window.ErrorOutputWriter.WriteLine(InteractiveWindowResources.CommandFailed, command.Names.First(), e.Message); return ExecutionResult.Failure; } }
private string ExecuteCommand(IInteractiveWindowCommand cmd, string args) { _window.ClearScreen(); var execute = cmd.Execute(_window, args); execute.Wait(); Assert.IsTrue(execute.Result.IsSuccessful); return _window.Output.TrimEnd(); }