public void It_should_instantiate_new_scenario_progress_notifier_for_each_scenario()
        {
            var notifiers = new List <CapturingProgressNotifier>();

            Func <object, IScenarioProgressNotifier> captureNotifierCreation = fixture =>
            {
                var notifier = new CapturingProgressNotifier();
                notifiers.Add(notifier);
                return(notifier);
            };

            var runner = new TestableFeatureRunnerRepository(NoProgressNotifier.Default, captureNotifierCreation).GetRunnerFor(GetType()).GetBddRunner(this);

            runner.Test().TestNamedScenario("scenario1", TestStep.CreateSync(Given_step_one));
            runner.Test().TestNamedScenario("scenario2", TestStep.CreateSync(Given_step_one));
            runner.Test().TestNamedScenario("scenario3", TestStep.CreateSync(Given_step_one));

            Assert.That(notifiers.Count, Is.EqualTo(3));
            Assert.That(notifiers[0].Notifications.Count(n => n.StartsWith("Scenario Start: scenario1")), Is.EqualTo(1), "scenario1");
            Assert.That(notifiers[1].Notifications.Count(n => n.StartsWith("Scenario Start: scenario2")), Is.EqualTo(1), "scenario2");
            Assert.That(notifiers[2].Notifications.Count(n => n.StartsWith("Scenario Start: scenario3")), Is.EqualTo(1), "scenario3");
        }
        public void Comment_should_throw_exception_if_feature_is_not_enabled()
        {
            var runner = new TestableFeatureRunnerRepository(
                TestableIntegrationContextBuilder.Default()
                .WithConfiguration(cfg => cfg.ExecutionExtensionsConfiguration().EnableScenarioExecutionContext())
                )
                         .GetRunnerFor(GetType())
                         .GetBddRunner(this);

            var exception = Assert.Throws <InvalidOperationException>(() => runner.Test().TestScenario(TestStep.CreateAsync(Commented_step, "some comment")));

            Assert.That(exception.Message, Is.EqualTo("Current task is not executing any scenario steps or commenting feature is not enabled in LightBddConfiguration. Ensure that configuration.ExecutionExtensionsConfiguration().EnableStepCommenting() is called during LightBDD initialization and commenting feature is called from task running scenario step."));
        }