示例#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>"));
        }