StatLight.Core.Reporting.Providers.Xml.XmlReport.GetXmlReport C# (CSharp) Method

GetXmlReport() public method

public GetXmlReport ( ) : System.Xml.Linq.XDocument
return System.Xml.Linq.XDocument
        public XDocument GetXmlReport()
        {
            var root = new XDocument(
                new XElement("StatLightTestResults"
                    , new XAttribute("total", _report.TotalResults)
                    , new XAttribute("ignored", _report.TotalIgnored)
                    , new XAttribute("failed", _report.TotalFailed)
                    , new XAttribute("dateRun", _report.DateTimeRunCompleted.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture))

                    , GetTestsRuns(_report)
                ))
                {
                    Declaration = new XDeclaration("1.0", "", "")
                };
            return root;
        }

Usage Example

Ejemplo n.º 1
0
 public void Should_not_throw_any_exceptions_if_there_are_no_tests()
 {
     XmlReport xmlReport = new XmlReport(new TestReport("Test.xap").ToTestReportCollection());
     xmlReport.GetXmlReport().ToString().ShouldNotBeEmpty();
 }