public void ListPrompt_CanIncludeQuotes()
 {
     new AppRunner <App>()
     .UsePrompting()
     .VerifyScenario(_testOutputHelper, new Scenario
     {
         Given    = { OnPrompt = Respond.WithList(new[] { "something", "simple", "'or not'", "\"so simple\"" }) },
         WhenArgs = $"{nameof(App.DoList)}",
         Then     =
         {
             Outputs = { new List <string> {
                             "something", "simple", "'or not'", "\"so simple\""
                         } }
         }
     });
 }
        public void WhenOperandListMissing_Prompts()
        {
            new AppRunner <App>()
            .UsePrompting()
            .VerifyScenario(_testOutputHelper, new Scenario
            {
                Given    = { OnPrompt = Respond.WithList(new [] { "something", "simple" }) },
                WhenArgs = $"{nameof(App.DoList)}",
                Then     =
                {
                    Outputs = { new List <string> {
                                    "something", "simple"
                                } },
                    Result  = @"args (Text) [<enter> once to begin new value. <enter> twice to finish]:
something
simple"
                }
            });
        }
Ejemplo n.º 3
0
 public void ListPrompt_CanIncludeQuotes()
 {
     new AppRunner <App>()
     .UseArgumentPrompter()
     .Verify(new Scenario
     {
         When =
         {
             Args     = $"{nameof(App.DoList)}",
             OnPrompt = Respond.WithList(new[] { "something","simple",               "'or not'", "\"so simple\"" })
         },
         Then =
         {
             AssertContext = ctx => ctx.ParamValuesShouldBe(
                 new List <string> {
                 "something", "simple", "'or not'", "\"so simple\""
             }),
         }
     });
 }
Ejemplo n.º 4
0
        public void WhenOperandListMissing_Prompts()
        {
            new AppRunner <App>()
            .UseArgumentPrompter()
            .Verify(new Scenario
            {
                When =
                {
                    Args     = $"{nameof(App.DoList)}",
                    OnPrompt = Respond.WithList(new [] { "something","simple"                })
                },
                Then =
                {
                    AssertContext = ctx => ctx.ParamValuesShouldBe(new List <string> {
                        "something", "simple"
                    }),
                    Output        = @"args (Text) [<enter> once to begin new value. <enter> twice to finish]: 
something
simple

"
                }
            }, config: TestConfig.Default.Where(c => c.SkipTrimEndOfConsoleOutputs = true));
        }
Ejemplo n.º 5
0
        public void WhenOperandListMissing_Prompts()
        {
            new AppRunner <App>()
            .UsePrompting()
            .Verify(new Scenario
            {
                When =
                {
                    Args     = $"{nameof(App.DoList)}",
                    OnPrompt = Respond.WithList(new [] { "something","simple"                })
                },
                Then =
                {
                    AssertContext = ctx => ctx.ParamValuesShouldBe(new List <string> {
                        "something", "simple"
                    }),
                    Output        = @"args (Text) [<enter> once to begin new value. <enter> twice to finish]: 
something
simple

"
                }
            });
        }