コード例 #1
0
 private IScenarioResult GetScenarioResult(string scenarioId)
 {
     return(FeatureRunnerProvider.GetRunnerFor(GetType())
            .GetFeatureResult()
            .GetScenarios()
            .Single(s => s.Info.Labels.Contains(scenarioId)));
 }
コード例 #2
0
        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"
            }));
        }