public static SpecFlowFeature CreateFeature(string[] tags = null, string[] scenarioTags = null) { tags = tags ?? new string[0]; var scenario1 = new Scenario(GetTags(scenarioTags), null, "Scenario", "scenario1 title", "", new Step[0]); return new SpecFlowFeature(GetTags(tags), null, "en", "feature", "title", "desc", null, new ScenarioDefinition[] {scenario1}, new Comment[0], null); }
internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null) { G.Scenario scenario = new G.Scenario( tags.Select(this.CreateTag).ToArray(), location ?? AnyLocation, "Scenario", name, description, steps); return(scenario); }
public void InvokeScenario (Scenario scenario, IEnumerable<MethodInfo> availableMethods) { foreach (var step in scenario.Steps) { _formatter.Log (step); MethodInfo stepMethod = GetStepMethod (step, availableMethods); // TODO steps should be global - create GetStepMethodDeclaringObject() if (stepMethod == null) { // TODO notify the formatter of the step not having stepMethod continue; } var obj = Activator.CreateInstance(stepMethod.DeclaringType); stepMethod.Invoke (obj, null); } }
public Scenario MapToScenario(G.Scenario scenario) { if (scenario == null) { return(null); } return(new Scenario { Description = scenario.Description ?? string.Empty, Location = this.MapToLocation(scenario.Location), Name = scenario.Name, Slug = scenario.Name.ToSlug(), Steps = scenario.Steps.Select(this.MapToStep).ToList(), Tags = scenario.Tags.Select(this.MapToString).ToList() }); }
public Scenario MapToScenario(G.Scenario scenario, params string[] tagsToHide) { if (scenario == null) { return(null); } var visibleTags = RetrieveOnlyVisibleTags(scenario.Tags, tagsToHide); return(new Scenario { Description = scenario.Description ?? string.Empty, Location = this.MapToLocation(scenario.Location), Name = scenario.Name, Slug = scenario.Name.ToSlug(), Steps = scenario.Steps.Select(this.MapToStep).ToList(), Tags = visibleTags }); }
public ScenarioOutline MapToScenarioOutline(G.Scenario scenarioOutline, params string[] tagsToHide) { if (scenarioOutline == null) { return(null); } var visibleTags = RetrieveOnlyVisibleTags(scenarioOutline.Tags, tagsToHide); return(new ScenarioOutline { Description = scenarioOutline.Description ?? string.Empty, Examples = (scenarioOutline.Examples ?? new G.Examples[0]).Select(this.MapToExample).ToList(), Location = this.MapToLocation(scenarioOutline.Location), Name = scenarioOutline.Name, Slug = scenarioOutline.Name.ToSlug(), Steps = scenarioOutline.Steps.Select(this.MapToStep).ToList(), Tags = visibleTags }); }
public Scenario MapToScenario(G.Scenario scenario) { return(this.mapper.Map <Scenario>(scenario)); }
internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null) { G.Scenario scenario = new G.Scenario( tags.Select(this.CreateTag).ToArray(), location ?? AnyLocation, "Scenario", name, description, steps); return scenario; }
public void Log (Scenario scenario) { Console.WriteLine (" Scenario: {0}", scenario.Name); }