コード例 #1
0
        public void write_stream()
        {
            var document = new XmlDocument();

            document.WithRoot("root");

            theRecordedOutput.Write("text/xml", document.Save);
            theRecordedOutput.Outputs.First().ShouldEqual(new SetContentType("text/xml"));

            var writeStream = theRecordedOutput.Outputs.Last().ShouldBeOfType <WriteStream>();

            writeStream.ReadAll().ShouldEqual(document.OuterXml);
        }
コード例 #2
0
        public void get_headers()
        {
            theRecordedOutput.AppendHeader("a", "1");
            theRecordedOutput.AppendHeader("b", "2");
            theRecordedOutput.AppendHeader("c", "3");

            theRecordedOutput.Write("stuff");
            theRecordedOutput.Write("more stuff");
            theRecordedOutput.Write("other stuff");

            theRecordedOutput.Headers().ShouldHaveTheSameElementsAs(new Header("a", "1"), new Header("b", "2"), new Header("c", "3"));
        }