예제 #1
0
 private IScenarioResult GetScenarioResult(string scenarioId)
 {
     return(FeatureRunnerProvider.GetRunnerFor(GetType())
            .GetFeatureResult()
            .GetScenarios()
            .Single(s => s.Info.Labels.Contains(scenarioId)));
 }
        public void Runner_should_throw_meaningful_exception_if_scenario_is_not_run_from_class_with_FeatureFixture_attribute()
        {
            var       runner = FeatureRunnerProvider.GetRunnerFor(GetType()).GetBddRunner(this);
            Exception ex     = Assert.Throws <InvalidOperationException>(() => runner.RunScenario(Some_step));

            Assert.That(
                ex.Message,
                Is.EqualTo("Unable to locate Scenario name. Please ensure that scenario is executed from method with [Scenario] attribute and test class deriving from FeatureFixture or with [FeatureFixture] attribute."));
        }
예제 #3
0
        public void It_should_capture_xunit_specific_attributes()
        {
            Runner.RunScenario(Some_step);

            var result = FeatureRunnerProvider.GetRunnerFor(GetType()).GetFeatureResult();

            Assert.Equal("desc", result.Info.Description);

            var scenario = GetScenarioResult(nameof(It_should_capture_xunit_specific_attributes));

            Assert.Equal(
                new[] { "Category A", "Category B" },
                scenario.Info.Categories.ToArray());
        }
예제 #4
0
        public void It_should_capture_nunit_specific_attributes()
        {
            Runner.RunScenario(Some_step);

            var result = FeatureRunnerProvider.GetRunnerFor(GetType()).GetFeatureResult();

            result.Info.Description.ShouldBe("desc");

            var scenario = GetScenarioResult(nameof(It_should_capture_nunit_specific_attributes));

            scenario.Info.Categories.ShouldBe(new[]
            {
                "Category A",
                "Category B",
                "Category C"
            });
        }
예제 #5
0
        public void It_should_capture_nunit_specific_attributes()
        {
            Runner.RunScenario(Some_step);

            var result = FeatureRunnerProvider.GetRunnerFor(GetType()).GetFeatureResult();

            Assert.That(result.Info.Description, Is.EqualTo("desc"));

            var scenario = GetScenarioResult(nameof(It_should_capture_nunit_specific_attributes));

            Assert.That(scenario.Info.Categories.ToArray(), Is.EquivalentTo(new[]
            {
                "Category A",
                "Category B",
                "Category C",
                "Category D",
                "Category E"
            }));
        }