Пример #1
0
        public void ShouldWriteTheXmlPreprocessingInstructionWhenCallingRenderAndTheDocTypeIsXml()
        {
            var docType   = new DocType("xml");
            var xmlWriter = Mock.Of <IXmlWriter>();

            docType.Render(xmlWriter);

            Mock.Get(xmlWriter).Verify(w => w.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"));
        }
Пример #2
0
        public void ShouldWriteTheDoctypeWhenCallingRenderAndTheDocTypeIsStrict()
        {
            var docType   = new DocType("strict");
            var xmlWriter = Mock.Of <IXmlWriter>();

            docType.Render(xmlWriter);

            Mock.Get(xmlWriter).Verify(w => w.WriteString(It.Is <string>(s => s.Contains("xhtml1-strict.dtd"))));
        }
Пример #3
0
        public void ShouldWriteTheDocTypeWhenCallingRenderAndTheDocTypeIsNotAKnowValue()
        {
            var docType   = new DocType("hello");
            var xmlWriter = Mock.Of <IXmlWriter>();

            docType.Render(xmlWriter);

            Mock.Get(xmlWriter).Verify(w => w.WriteString("<!DOCTYPE hello>"));
        }