public XElement Format(ScenarioOutline scenarioOutline, int id) { return(new XElement(xmlns + "li", new XAttribute("class", "scenario"), htmlImageResultFormatter.Format(scenarioOutline), FormatHeading(scenarioOutline), FormatSteps(scenarioOutline), scenarioOutline.Example == null ? null : FormatExamples(scenarioOutline) )); }
public XElement Format(Scenario scenario, int id) { return(new XElement(xmlns + "li", new XAttribute("class", "scenario"), htmlImageResultFormatter.Format(scenario), new XElement(xmlns + "div", new XAttribute("class", "scenario-heading"), new XElement(xmlns + "h2", scenario.Name), htmlDescriptionFormatter.Format(scenario.Description) ), new XElement(xmlns + "div", new XAttribute("class", "steps"), new XElement(xmlns + "ul", scenario.Steps.Select(step => htmlStepFormatter.Format(step))) ) )); }
public XElement Format(Feature feature) { var div = new XElement(xmlns + "div", new XAttribute("id", "feature"), htmlImageResultFormatter.Format(feature), new XElement(xmlns + "h1", feature.Name), htmlDescriptionFormatter.Format(feature.Description) ); var scenarios = new XElement(xmlns + "ul", new XAttribute("id", "scenarios")); int id = 0; if (feature.Background != null) { scenarios.Add(htmlScenarioFormatter.Format(feature.Background, id++)); } foreach (IFeatureElement featureElement in feature.FeatureElements) { var scenario = featureElement as Scenario; if (scenario != null) { scenarios.Add(htmlScenarioFormatter.Format(scenario, id++)); } var scenarioOutline = featureElement as ScenarioOutline; if (scenarioOutline != null) { scenarios.Add(htmlScenarioOutlineFormatter.Format(scenarioOutline, id++)); } } div.Add(scenarios); return(div); }