Exemplo n.º 1
0
 public void ChidDialog_pick_number_to_many_attempts()
 {
     var childDialogFluentTest = new ChildDialogFluentTest()
                                 .Create()
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Please pick a number between one and ten (hint: UnitX).", m[0].Text);
         return(m[0].MakeReply("33"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Please enter a number between one and ten.", m[0].Text);
         return(m[0].MakeReply("33"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Please enter a number between one and ten.", m[0].Text);
         return(m[0].MakeReply("33"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Please enter a number between one and ten.", m[0].Text);
         return(m[0].MakeReply("33"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Too many attempts. I'm ending this conversation.", m[0].Text);
     });
 }
Exemplo n.º 2
0
 public void ChidDialog_happy_path()
 {
     var childDialogFluentTest = new ChildDialogFluentTest()
                                 .Create()
                                 .Message(m => {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Please pick a number between one and ten (hint: UnitX).", m[0].Text);
         return(m[0].MakeReply("33"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Please enter a number between one and ten.", m[0].Text);
         return(m[0].MakeReply("10"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, you picked the wrong number. Do you want to try again?", m[0].Text);
         return(m[0].MakeReply("Yes"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Please pick a number between one and ten (hint: UnitX).", m[0].Text);
         return(m[0].MakeReply("1"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Congratulations. You picked the correct number.", m[0].Text);
     });
 }
Exemplo n.º 3
0
 public void ChidDialog_confirm_retry_too_many_attempts()
 {
     var childDialogFluentTest = new ChildDialogFluentTest()
                                 .Create()
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Please pick a number between one and ten (hint: UnitX).", m[0].Text);
         return(m[0].MakeReply("5"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, you picked the wrong number. Do you want to try again?", m[0].Text);
         return(m[0].MakeReply("Not a confirmation"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Do you want to enter a new number?", m[0].Text);
         return(m[0].MakeReply("Not a confirmation"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Do you want to enter a new number?", m[0].Text);
         return(m[0].MakeReply("Not a confirmation"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Sorry, I didn't get that. Do you want to enter a new number?", m[0].Text);
         return(m[0].MakeReply("Not a confirmation"));
     })
                                 .Message(m =>
     {
         Assert.AreEqual(1, m.Count);
         Assert.AreEqual("Too many attempts. I'm ending this conversation.", m[0].Text);
     });
 }