public async Task TestExecuteInstallScriptWrongArgsAsync(string cmdArgs = "-switchThatDoesntExist") { try { ScriptExecutionResult executionResult = await InstallScriptRunner.ExecuteInstallScriptAsync(cmdArgs).ConfigureAwait(false); Assert.IsFalse(string.IsNullOrWhiteSpace(executionResult.Error), $"Script execution hasn't returned any errors, but it should have." + $" Used command line arguments: " + cmdArgs); } catch (Exception e) { Assert.Fail($"Script execution has failed with an exception: {e.ToString()}"); } }
public async Task TestExecuteInstallScriptAsync(string cmdArgs = "-DryRun") { try { ScriptExecutionResult executionResult = await InstallScriptRunner.ExecuteInstallScriptAsync(cmdArgs).ConfigureAwait(false); Assert.IsFalse(string.IsNullOrWhiteSpace(executionResult.Output), "Script execution hasn't returned an output."); Assert.IsTrue(string.IsNullOrWhiteSpace(executionResult.Error), $"Script execution has returned the following error: {executionResult.Error}"); } catch (Exception e) { Assert.Fail($"Script execution has failed with an exception: {e.ToString()}"); } }