Пример #1
0
        internal static void RegisterScenario(SbeScenario scenario, SpecflowContextWrapper specflowContext)
        {
            var assembly = GetCurrentAssembly(scenario.AssemblyName);
            var epic     = GetCurrentEpic(assembly, specflowContext);
            var feature  = GetCurrentFeature(epic, specflowContext);

            feature.Scenarios.Add(scenario);
        }
Пример #2
0
        internal static SbeScenario GetScenario(ITestOutcomeEvent e, SpecflowContextWrapper specflowContext)
        {
            var testReflection = ReflectionService.GetTestMethodInfo(e);

            return(new SbeScenario
            {
                Title = specflowContext.ScenarioTitle,
                Tags = specflowContext.ScenarioTags,
                Outcome = e.Outcome,
                AssemblyName = testReflection.AssemblyName,
                NamedArgumets = testReflection.NamedArgumets
            });
        }
Пример #3
0
        private static SbeEpic GetCurrentEpic(SbeAssembly assembly, SpecflowContextWrapper specflowContext)
        {
            var epicName = specflowContext.GetEpicName();

            if (!assembly.Epics.TryGetValue(epicName, out SbeEpic epic))
            {
                epic = new SbeEpic
                {
                    Name = epicName,
                };
                assembly.Epics.Add(epicName, epic);
            }

            return(epic);
        }
Пример #4
0
        private static SbeFeature GetCurrentFeature(SbeEpic epic, SpecflowContextWrapper specflowContext)
        {
            var title = specflowContext.FeatureTitle;

            if (!epic.Features.TryGetValue(title, out SbeFeature feature))
            {
                feature = new SbeFeature
                {
                    Title = specflowContext.FeatureTitle,
                    Tags  = specflowContext.FeatureTags,
                };
                epic.Features.Add(title, feature);
            }

            return(feature);
        }