コード例 #1
0
ファイル: BlendStepTests.cs プロジェクト: davidov541/SAMI
        public void BlendStepCloneTest()
        {
            BlendStep originalStep = new BlendStep();
            BlendStep clonedStep   = originalStep.Clone() as BlendStep;

            Assert.IsNotNull(clonedStep);
            Assert.AreEqual(originalStep.IsStepDone, clonedStep.IsStepDone);
            Assert.AreEqual(originalStep.MessageToUser, clonedStep.MessageToUser);
            Assert.AreEqual(originalStep.Name, clonedStep.Name);
            Assert.AreEqual(originalStep.NextGrammarNeeded, clonedStep.NextGrammarNeeded);
            Assert.AreEqual(originalStep.ShouldCancel, clonedStep.ShouldCancel);
        }
コード例 #2
0
ファイル: BlendStepTests.cs プロジェクト: davidov541/SAMI
        public void BlendStepDoStepInvalidUserInputTest()
        {
            BlendStep step = new BlendStep();
            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("Blend the drink.", step.MessageToUser);
            Assert.AreEqual(false, step.IsStepDone);
            Assert.AreEqual("Blend", step.Name);
            Assert.AreEqual(BartenderApp.ConfirmationRuleName, step.NextGrammarNeeded);
            Assert.AreEqual(false, step.ShouldCancel);
        }
コード例 #3
0
ファイル: BlendStepTests.cs プロジェクト: davidov541/SAMI
        public void BlendStepDoStepFalseAnswerTest()
        {
            BlendStep step = new BlendStep();
            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("Blend", step.Name);
            Assert.AreEqual(null, step.NextGrammarNeeded);
            Assert.AreEqual(true, step.ShouldCancel);
        }