public void Should_pick_up_step_implementations_via_attributes_from_supplied_helper_object()
        {
            var helper = new AttributedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("Given using attributes to obtain a step", null));

            Assert.That(helper.StepResult, Is.EqualTo(1));
        }
        public void Should_pick_up_step_implementations_via_attributes_from_supplied_helper_object_and_obtain_regex_captures()
        {
            var helper = new AttributedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("Given setting result via regex capture to 12", null));

            Assert.That(helper.StepResult, Is.EqualTo(12));
        }
        public void Should_pick_up_step_implementations_via_reflection_from_supplied_helper_object()
        {
            var helper = new ReflectionBasedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("When using reflection to obtain a step", null));

            Assert.IsTrue(helper.HasRun);
        }
        public void Should_pick_up_step_implementations_via_attributes_from_supplied_helper_object_and_obtain_regex_captures()
        {
            var helper     = new AttributedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("Given", "setting result via regex capture to 12", null));

            Assert.That(helper.StepResult, Is.EqualTo(12));
        }
        public void Should_pick_up_step_implementations_via_attributes_from_supplied_helper_object()
        {
            var helper     = new AttributedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("Given", "using attributes to obtain a step", null));

            Assert.That(helper.StepResult, Is.EqualTo(1));
        }
        public void Should_pick_up_step_implementations_via_reflection_from_supplied_helper_object()
        {
            var helper     = new ReflectionBasedScenarioHelper();
            var stepRunner = new ScenarioDrivenSpecStepRunner(helper);

            stepRunner.Run(new StringStep("When", "using reflection to obtain a step", null));

            Assert.IsTrue(helper.HasRun);
        }
        public void Should_allow_specified_step_implementations()
        {
            var stepRunner = new ScenarioDrivenSpecStepRunner(null);

            var didRun = false;

            stepRunner.RegisterImplementation(ScenarioFragment.Given, "change my flag", () => didRun = true);

            stepRunner.Run(new StringStep("Given change my flag", null));

            Assert.IsTrue(didRun);
        }
        public void Should_allow_specified_step_implementations()
        {
            var stepRunner = new ScenarioDrivenSpecStepRunner(null);

            var didRun = false;

            stepRunner.RegisterImplementation(ScenarioFragment.Given, "change my flag", () => didRun = true);

            stepRunner.Run(new StringStep("Given", "change my flag", null));

            Assert.IsTrue(didRun);
        }