public static SpecificationDataset Build(Assembly assemblyUnderTest) { SpecificationDataset specificationDataset = new SpecificationDataset(assemblyUnderTest); specificationDataset.BuildConcerns(); return(specificationDataset); }
public static string RenderTitle(SpecificationDataset specificationDataset) { StringBuilder reportBuilder = new StringBuilder(); RenderTitle(specificationDataset, reportBuilder); return(reportBuilder.ToString()); }
private static void RenderTitle(SpecificationDataset specificationDataset, StringBuilder reportBuilder) { string concernsCaption = ConcernsCaption(specificationDataset.Concerns); string contextsCaption = ContextsCaption(specificationDataset.Concerns); string specificationsCaption = SpecificationsCaption(specificationDataset.Concerns); string title = String.Format("<h1>{0} <span class=\"count\">{1}, {2}, {3}</span></h1>", specificationDataset.Name, concernsCaption, contextsCaption, specificationsCaption); reportBuilder.Append(title); }
public static string Render(SpecificationDataset specificationDataset) { StringBuilder reportBuilder = new StringBuilder(); RenderTitle(specificationDataset, reportBuilder); RenderHR(reportBuilder); Concern[] concerns = (from c in specificationDataset.Concerns orderby c.Name select c).ToArray(); RenderConcerns(concerns, reportBuilder); string reportBody = reportBuilder.ToString(); return(String.Format(GetTemplate(), specificationDataset.Name, reportBody)); }
public virtual void WriteReport(Assembly assemblyUnderTest) { SpecificationDataset specificationDataset = SpecificationDataset.Build(assemblyUnderTest); string generatedReport = Render(specificationDataset); string reportFilePath = assemblyUnderTest.GetName().Name + ".html"; if (File.Exists(reportFilePath)) { File.Delete(reportFilePath); } TextWriter tw = new StreamWriter(reportFilePath); tw.Write(generatedReport); tw.Close(); }