public void StrainStepDoStepInvalidUserInputTest() { StrainStep step = new StrainStep(); 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("Strain the drink.", step.MessageToUser); Assert.AreEqual(false, step.IsStepDone); Assert.AreEqual("Strain", step.Name); Assert.AreEqual(BartenderApp.ConfirmationRuleName, step.NextGrammarNeeded); Assert.AreEqual(false, step.ShouldCancel); }
public void StrainStepDoStepFalseAnswerTest() { StrainStep step = new StrainStep(); 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("Strain", step.Name); Assert.AreEqual(null, step.NextGrammarNeeded); Assert.AreEqual(true, step.ShouldCancel); }