コード例 #1
0
        public void DoesNotStopExecutingScenarioIfStepFailsAndStopOnErrorIsNotSet()
        {
            RemembersStepsExecuted.Reset();

            var feature = new Feature("has an error", NoTags())
            {
                Scenarios =
                {
                    new ExecutableScenario("has an error", NoTags())
                    {
                        Steps =
                        {
                            Step.Given("step1"),
                            Step.Given("step2"),
                            Step.Given("step3"),
                        }
                    }
                }
            };

            runner.Run(feature, new[] { typeof(RemembersStepsExecuted) }, new RunnerOptions {
                SuccessRequired = false
            });

            Assert.IsTrue(RemembersStepsExecuted.StepNames.Contains("step3"));
        }
コード例 #2
0
        public void StopsExecutingScenarioIfStepIsPendingAndStopOnErrorIsSet()
        {
            RemembersStepsExecuted.Reset();

            var feature = new Feature("has an error", NoTags())
            {
                Scenarios =
                {
                    new ExecutableScenario("has an error", NoTags())
                    {
                        Steps =
                        {
                            Step.Given("step1"),
                            Step.Given("step2 does not exist"),
                            Step.Given("step3"),
                        }
                    }
                }
            };

            runner.Run(feature, new[] { typeof(RemembersStepsExecuted) }, new RunnerOptions {
                SuccessRequired = true
            });

            Assert.IsFalse(RemembersStepsExecuted.StepNames.Contains("step3"));
        }