예제 #1
0
 public async Task Pizza_fr_Script()
 {
     await VerifyFormScript(@"..\..\PizzaForm-fr.script",
                            "fr", () => PizzaOrder.BuildForm(), FormOptions.None, new PizzaOrder(), Array.Empty <EntityRecommendation>(),
                            "bonjour",
                            "2",
                            "moyen",
                            "4",
                            "?",
                            "1 2",
                            "retourner",
                            "c",
                            "non",
                            "fine",
                            "1",
                            "?",
                            "bovine, oignons, ice cream",
                            "oignons",
                            "statut",
                            "abc",
                            "1 state street",
                            "oui",
                            "1 2",
                            "non",
                            "2,5",
                            "25/2/1962 3pm",
                            "non",
                            "1234",
                            "123-4567",
                            "non",
                            "nappages",
                            "non epinards",
                            "oui"
                            );
 }
예제 #2
0
 public async Task Pizza_Entities_Script()
 {
     await VerifyFormScript(@"..\..\PizzaForm-entities.script",
                            "en-us", () => PizzaOrder.BuildForm(), FormOptions.None, new PizzaOrder(),
                            new Luis.Models.EntityRecommendation[] {
         new Luis.Models.EntityRecommendation("Address", "abc", "DeliveryAddress"),
         new Luis.Models.EntityRecommendation("Kind", "byo", "Kind"),
         // This should be skipped because it is not active
         new Luis.Models.EntityRecommendation("Signature", "Hawaiian", "Signature"),
         new Luis.Models.EntityRecommendation("Toppings", "onions", "BYO.Toppings"),
         new Luis.Models.EntityRecommendation("Toppings", "peppers", "BYO.Toppings"),
         new Luis.Models.EntityRecommendation("Toppings", "ice", "BYO.Toppings"),
         new Luis.Models.EntityRecommendation("NotFound", "OK", "Notfound")
     },
                            "hi",
                            "1", // onions for topping clarification
                            "2",
                            "med",
                            // Kind "4",
                            "drink bread",
                            "thin",
                            "1",
                            "?",
                            // "beef, onion, ice cream",
                            "3",
                            "y",
                            "1 2",
                            "none",
                            "2.5",
                            "2/25/1962 3pm",
                            "no",
                            "123-4567",
                            "y"
                            );
 }
예제 #3
0
 public async Task FormFlow_Localization()
 {
     // This ensures there are no bad templates in resources
     foreach (var locale in new string[] { "ar", "cs", "de", "en", "es", "fa", "fr", "it", "ja", "ru", "zh-Hans", "cs", "de-DE" })
     {
         var root = new FormDialog <PizzaOrder>(new PizzaOrder(), () => PizzaOrder.BuildForm(), cultureInfo: CultureInfo.GetCultureInfo(locale));
         Assert.AreNotEqual(null, root);
     }
 }
예제 #4
0
        public async Task Pizza_Button_Script()
        {
            var pathScript = TestFiles.DeploymentItemPathsForCaller(TestContext, this.GetType()).Single();

            await VerifyFormScript(pathScript,
                                   "en-us", () => PizzaOrder.BuildForm(style: ChoiceStyleOptions.Auto), FormOptions.None, new PizzaOrder(), Array.Empty <EntityRecommendation>(),
                                   "hi",
                                   "garbage",
                                   "2",
                                   "med",
                                   "4",
                                   "help",
                                   "drink bread",
                                   "back",
                                   "c",
                                   "garbage",
                                   "no",
                                   "thin",
                                   "1",
                                   "?",
                                   "garbage",
                                   "beef, onion, ice cream",
                                   "garbage",
                                   "onions",
                                   "status",
                                   "abc",
                                   "2",
                                   "garbage",
                                   "iowa",
                                   "y",
                                   "1 2",
                                   "none",
                                   "garbage",
                                   "2.5",
                                   "garbage",
                                   "2/25/1962 3pm",
                                   "no",
                                   "1234",
                                   "123-4567",
                                   "no",
                                   "toppings",
                                   "everything but spinach",
                                   "y"
                                   );
        }
        public TestBot(TestBotAccessors accessors)
        {
            // create the DialogSet from accessor
            _dialogs = new DialogSet(accessors.ConversationDialogState);

            // a semaphore to serialize access to the bot state
            _semaphore = accessors.SemaphoreSlim;

            // add the various named dialogs that can be used
            _dialogs.Add(new MenuDialog());
            _dialogs.Add(FormDialog.FromForm(Order.BuildOrderForm));
            _dialogs.Add(FormDialog.FromForm(SandwichOrder.BuildForm));
            _dialogs.Add(FormDialog.FromForm(BuilderSandwich.BuildForm));
            _dialogs.Add(FormDialog.FromForm(() => PizzaOrder.BuildForm(localize: true)));
            _dialogs.Add(FormDialog.FromForm(ScheduleCallbackDialog.BuildForm));
            _dialogs.Add(FormDialog.FromForm(ImagesForm.BuildForm));
            _dialogs.Add(new HotelsDialog()); //<--loads a FormFlow dialog and does processing with the results
        }
예제 #6
0
 public async Task Pizza_Button_Script()
 {
     await VerifyFormScript(@"..\..\PizzaFormButton.script",
                            "en-us", () => PizzaOrder.BuildForm(style: ChoiceStyleOptions.Auto), FormOptions.None, new PizzaOrder(), Array.Empty <EntityRecommendation>(),
                            "hi",
                            "garbage",
                            "2",
                            "med",
                            "4",
                            "help",
                            "drink bread",
                            "back",
                            "c",
                            "garbage",
                            "no",
                            "thin",
                            "1",
                            "?",
                            "garbage",
                            "beef, onion, ice cream",
                            "garbage",
                            "onions",
                            "status",
                            "abc",
                            "2",
                            "garbage",
                            "iowa",
                            "y",
                            "1 2",
                            "none",
                            "garbage",
                            "2.5",
                            "garbage",
                            "2/25/1962 3pm",
                            "no",
                            "1234",
                            "123-4567",
                            "no",
                            "toppings",
                            "everything but spinach",
                            "y"
                            );
 }
예제 #7
0
        public async Task Pizza_fr_Script()
        {
            var pathScript = TestFiles.DeploymentItemPathsForCaller(TestContext, this.GetType()).Single();

            await VerifyFormScript(pathScript,
                                   "fr", () => PizzaOrder.BuildForm(), FormOptions.None, new PizzaOrder(), Array.Empty <EntityRecommendation>(),
                                   "bonjour",
                                   "2",
                                   "moyen",
                                   "4",
                                   "?",
                                   "1 2",
                                   "retourner",
                                   "c",
                                   "non",
                                   "fine",
                                   "1",
                                   "?",
                                   "bovine, oignons, ice cream",
                                   "oignons",
                                   "statut",
                                   "abc",
                                   "1 state street",
                                   "oui",
                                   "1 2",
                                   "non",
                                   "2,5",
                                   "25/2/1962 3pm",
                                   "non",
                                   "1234",
                                   "123-4567",
                                   "non",
                                   "nappages",
                                   "non epinards",
                                   "oui"
                                   );
        }
예제 #8
0
        public async Task Pizza_Entities_Script()
        {
            var pathScript = TestFiles.DeploymentItemPathsForCaller(TestContext, this.GetType()).Single();

            await VerifyFormScript(pathScript,
                                   "en-us", () => PizzaOrder.BuildForm(), FormOptions.None, new PizzaOrder(),
                                   new Luis.Models.EntityRecommendation[] {
                new Luis.Models.EntityRecommendation("DeliveryAddress", entity: "2"),
                new Luis.Models.EntityRecommendation("Kind", entity: "byo"),
                // This should be skipped because it is not active
                new Luis.Models.EntityRecommendation("Signature", entity: "Hawaiian"),
                new Luis.Models.EntityRecommendation("BYO.Toppings", entity: "onions"),
                new Luis.Models.EntityRecommendation("BYO.Toppings", entity: "peppers"),
                new Luis.Models.EntityRecommendation("BYO.Toppings", entity: "ice"),
                new Luis.Models.EntityRecommendation("NumberOfPizzas", entity: "5"),
                new Luis.Models.EntityRecommendation("NotFound", entity: "OK")
            },
                                   "hi",
                                   "1", // onions for topping clarification
                                   "2", // address choice from validation
                                   "med",
                                        // Kind "4",
                                   "drink bread",
                                   "thin",
                                   "1",
                                   // "beef, onion, ice cream",
                                   // Already have address
                                   "y",
                                   "1 2",
                                   "none",
                                   "2.5",
                                   "2/25/1962 3pm",
                                   "no",
                                   "123-4567",
                                   "y"
                                   );
        }