Example #1
0
        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());
        }
Example #2
0
 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;
     }
 }
Example #4
0
 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();
 }