internal ScenarioBuilder(string scenarioName, Feature feature, CoreFactory factory) { this.factory = factory; outcomeAggregator = factory.UtilityFactory.CreateOutcomeAggregator(); scenario = factory.CreateScenario(scenarioName, feature); runner = factory.CreateScenarioRunner(scenario); }
internal Scenario CreateScenario(string name, Feature feature) { var scenario = new Scenario() { Name = name, Feature = feature, StepStats = new OutcomeStats() }; feature.Scenarios.Add(scenario); return scenario; }
internal Feature CreateFeature(string name, Area area) { var feature = new Feature() { Name = name, Area = area, ScenarioStats = new OutcomeStats(), StepStats = new OutcomeStats() }; area.Features.Add(feature); return feature; }
internal static HtmlReportLineItem GetHtmlReportLineItem(this xBDD.Model.Feature feature) { var li = new HtmlReportLineItem(); li.ChildItems = new List <HtmlReportLineItem>(); li.ChildStats = feature.ScenarioStats; li.ChildTypeName = "scenarios"; li.EndTime = feature.EndTime; li.StartTime = feature.StartTime; li.Name = feature.Name.HtmlEncode(); li.Outcome = feature.Outcome; li.Reason = feature.Reason; li.Assignments = feature.Assignments.ToList(); li.Tags = feature.Tags.ToList(); Dictionary <string, Dictionary <string, int> > reasonStats = new Dictionary <string, Dictionary <string, int> >(); reasonStats.Add("Scenarios", feature.ScenarioReasonStats); li.ReasonStats = reasonStats; li.TypeName = "feature"; var scenarios = feature.Scenarios.OrderBy(x => x.Sort).ToList(); foreach (var scenario in scenarios) { li.ChildItems.Add(scenario.GetHtmlReportLineItem()); } if (feature.AsA != null || feature.Capability != null || feature.SoThat != null) { var nl = System.Environment.NewLine; li.Statement = $@" <strong>As a</strong> {(feature.AsA != null ? feature.AsA : "[Missing Name!]")}<br/> <strong>You can </strong> {(feature.YouCan != null ? feature.YouCan : "[Missing Capability!]")}<br/> <strong>So that </strong> {(feature.SoThat != null ? feature.SoThat : "[Missing Value!]")}<br/>" .RemoveIndentation(5, true); } li.Explanation = feature.Explanation; li.ExplanationFormat = feature.ExplanationFormat; return(li); }
internal ScenarioBuilder CreateScenarioBuilder(string scenarioName, Feature feature) { return new ScenarioBuilder(scenarioName, feature, this); }