Ejemplo n.º 1
0
        public void GeneratesEmptyXDocumentForEmptyReport()
        {
            var exporter = new XmlExporter(new CoberturaReport());
            var xDoc     = exporter.GetCoberturaDocument();

            Assert.NotNull(xDoc);
            Assert.EndsWith("<coverage />", xDoc.ToString());
        }
Ejemplo n.º 2
0
        public void GeneratesCorrectXDocumentForReport()
        {
            var report      = GenerateReport();
            var exporter    = new XmlExporter(report);
            var actualDoc   = exporter.GetCoberturaDocument();
            var expectedDoc = GetExpectedXDocument();
            var comparator  = new XDocumentComparator(expectedDoc, actualDoc);

            comparator.AssertXDocumentsAreEqual();
        }
Ejemplo n.º 3
0
        public void HasXmlSignatureInEmptyReport()
        {
            var exporter = new XmlExporter(new CoberturaReport());
            var xDoc     = exporter.GetCoberturaDocument();

            using (var memStream = new MemoryStream())
            {
                xDoc.Save(memStream);
                memStream.Position = 0;
                using (var streamReader = new StreamReader(memStream))
                {
                    var xml = streamReader.ReadToEnd();
                    Assert.Contains("<?xml version=\"1.0\" encoding=\"utf-8\"?>", xml);
                }
            }
        }