public void TestSeeAlertEnterTextAndSelectButtonCallsPipelineAction()
        {
            var testPage = new Mock<IPage>();

            var pipelineService = new Mock<IActionPipelineService>(MockBehavior.Strict);
            pipelineService.Setup(p => p.PerformAction<DismissDialogAction>(
                testPage.Object,
                It.Is<DismissDialogAction.DismissDialogContext>(c => c.ButtonName == "Ok" && c.IsTextEntered && c.Text == "Hello!")))
                .Returns(ActionResult.Successful());

            var scenarioContext = new Mock<IScenarioContextHelper>(MockBehavior.Strict);
            scenarioContext.Setup(s => s.GetValue<IPage>(PageStepBase.CurrentPageKey)).Returns(testPage.Object);

            var steps = new AlertBoxSteps(pipelineService.Object, scenarioContext.Object);

            steps.SeeAlertEnterTextAndSelectButton("Hello!", "Ok");

            pipelineService.VerifyAll();
            scenarioContext.VerifyAll();
        }
Example #2
0
        public void TestSeeAlertEnterTextAndSelectButtonCallsPipelineAction()
        {
            var testPage = new Mock <IPage>();

            var pipelineService = new Mock <IActionPipelineService>(MockBehavior.Strict);

            pipelineService.Setup(p => p.PerformAction <DismissDialogAction>(
                                      testPage.Object,
                                      It.Is <DismissDialogAction.DismissDialogContext>(c => c.ButtonName == "Ok" && c.IsTextEntered && c.Text == "Hello!")))
            .Returns(ActionResult.Successful());

            var scenarioContext = new Mock <IScenarioContextHelper>(MockBehavior.Strict);

            scenarioContext.Setup(s => s.GetValue <IPage>(PageStepBase.CurrentPageKey)).Returns(testPage.Object);

            var steps = new AlertBoxSteps(pipelineService.Object, scenarioContext.Object);

            steps.SeeAlertEnterTextAndSelectButton("Hello!", "Ok");

            pipelineService.VerifyAll();
            scenarioContext.VerifyAll();
        }