public void WhenFlagsMissing_DoesNotPrompt() { new AppRunner <App>() .UseArgumentPrompter() .Verify(new Scenario { When = { Args = $"{nameof(App.Flags)}", OnPrompt = Respond.FailOnPrompt() }, Then = { Output = "" } }); }
public void PipedInputIsEvaluatedBeforePrompting() { var pipedInput = new[] { "a", "b", "c" }; new AppRunner <App>() .UseArgumentPrompter() .Verify(new Scenario { When = { Args = $"{nameof(App.DoList)}", PipedInput = pipedInput, OnPrompt = Respond.FailOnPrompt() }, Then = { AssertContext = ctx => ctx.ParamValuesShouldBe(pipedInput.ToList()) } }); }
public void When_OptionAndOperand_Missing_DoesNotPrompt_For_NRT_Parameters() { new AppRunner <App>() .UseArgumentPrompter() .Verify(new Scenario { When = { Args = $"{nameof(App.Do)}", OnPrompt = Respond.FailOnPrompt() }, Then = { AssertContext = ctx => ctx.ParamValuesShouldBe(null, null) } }); }
public void WhenOperandAndOptionProvided_DoesNotPrompt() { new AppRunner <App>() .UseArgumentPrompter() .Verify(new Scenario { When = { Args = $"{nameof(App.Do)} something --opt1 simple", OnPrompt = Respond.FailOnPrompt() }, Then = { AssertContext = ctx => ctx.ParamValuesShouldBe("simple", "something"), Output = "" } }); }