[S.R.Serialization] fix MTOM writer test to match .NET behavior.
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 15 Apr 2015 05:59:55 +0000 (14:59 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 24 Apr 2015 05:36:55 +0000 (14:36 +0900)
WriteStartDocument() can be used with document and document does not accept
more than one element, which basically contradicts MTOM writer usage.

For EOL changes, MTOM writer should not alter content EOL chars.

mcs/class/System.Runtime.Serialization/Test/System.Xml/XmlMtomDictionaryWriterTest.cs

index d57dbb698d0f77fa0cf3a27c6b932573c684404f..31ca0721bbc91266891823ce72affb817a446d64 100644 (file)
@@ -47,7 +47,6 @@ namespace MonoTests.System.Xml
                {
                        MemoryStream ms = new MemoryStream ();
                        var w = XmlDictionaryWriter.CreateMtomWriter (ms, Encoding.UTF8, 10000, "sTaRt", "myboundary", "urn:foo", false, false);
-                       w.WriteStartDocument ();
                        w.WriteStartElement ("root");
                        w.WriteRaw ("RAW");
                        w.WriteStartElement ("foo");
@@ -79,11 +78,11 @@ Content-ID: <urn:foo>
 Content-Transfer-Encoding: 8bit
 Content-Type: application/xop+xml;charset=utf-8;type=""sTaRt""
 
-<root>RAW<foo>bcdMjxG<arr>true</arr><arr>false</arr><arr>true</arr>AQIDBAU=999&#xD;
-&#xD;
+<root>RAW<foo>bcdMjxG<arr>true</arr><arr>false</arr><arr>true</arr>AQIDBAU=999&#xD;XXX
+&#xD;XXX
 666</foo></root>
 --myboundary--
-<root/><root/><root/>".Replace ("\n", "\r\n");
+<root/><root/><root/>".Replace ("\n", "\r\n").Replace ("XXX\r\n", "\n");
        }
 
        class MyStreamProvider : IStreamProvider