Exemplo n.º 1
0
        public void IgniteStepDoStepInvalidUserInputTest()
        {
            IgniteStep step = new IgniteStep();
            Mock <IBartenderController> bartender = new Mock <IBartenderController>(MockBehavior.Strict);

            bartender.Setup(s => s.IsValid).Returns(true);
            step.DoStep(new Dialog(new Dictionary <String, String>(), "Test Phrase"), bartender.Object);
            Assert.AreEqual("Ignite the drink.", step.MessageToUser);
            Assert.AreEqual(false, step.IsStepDone);
            Assert.AreEqual("Ignite", step.Name);
            Assert.AreEqual(BartenderApp.ConfirmationRuleName, step.NextGrammarNeeded);
            Assert.AreEqual(false, step.ShouldCancel);
        }
Exemplo n.º 2
0
        public void IgniteStepDoStepFalseAnswerTest()
        {
            IgniteStep step = new IgniteStep();
            Mock <IBartenderController> bartender = new Mock <IBartenderController>(MockBehavior.Strict);

            bartender.Setup(s => s.IsValid).Returns(true);
            Dictionary <String, String> input = new Dictionary <string, string>
            {
                { "answer", "false" },
            };

            step.DoStep(new Dialog(input, "Test Phrase"), bartender.Object);
            Assert.AreEqual(null, step.MessageToUser);
            Assert.AreEqual(true, step.IsStepDone);
            Assert.AreEqual("Ignite", step.Name);
            Assert.AreEqual(null, step.NextGrammarNeeded);
            Assert.AreEqual(true, step.ShouldCancel);
        }