private static void Main() { Report pdfReport = new PdfReport(); pdfReport.Generate(); Report xmlReport = new XmlReport(); xmlReport.Generate(); }
public void GenerateNoResults() { // arrange var writer = new MemoryFileWriter(); const string filePath = "<memory>"; var report = new XmlReport(writer, filePath); // act report.Generate(new MetricResult[] { }); // assert Assert.AreEqual("<metrics />", writer.Contents); Assert.AreEqual(filePath, writer.FilePath); }
public void GenerateSampleMetricResult() { var instance = new XmlReport(new MemoryFileWriter(), null); var sampleMetricResult = new MetricResultBuilder().CreateMetricResult(); instance.Generate(sampleMetricResult); AssertAreEqual(@" <metrics> <metric name=""Test Metric""> <class name=""Test Class 1""> <method name=""Test Method1"" pass=""false"" result=""12"" /> <method name=""Test Method2"" pass=""true"" result=""5"" /> </class> <class name=""Test Class 1""> <method name=""Test Method1"" pass=""false"" result=""12"" /> <method name=""Test Method2"" pass=""true"" result=""5"" /> </class> </metric> </metrics>", instance); }