コード例 #1
0
        public void SaveReadOnly4()
        {
            var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);

            doc.Load(_pathToCommonTargets);
            doc.Save(XmlWriter.Create(FileUtilities.GetTemporaryFile()));
        }
コード例 #2
0
        public void SaveReadOnly3()
        {
            var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);

            doc.Load(_pathToCommonTargets);
            doc.Save(new StringWriter());
        }
コード例 #3
0
        public void SaveReadOnly2()
        {
            var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);

            doc.Load(_pathToCommonTargets);
            doc.Save(new MemoryStream());
        }
コード例 #4
0
 public void SaveReadOnly4()
 {
     Assert.Throws <InvalidOperationException>(() =>
     {
         var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);
         doc.Load(_pathToCommonTargets);
         doc.Save(XmlWriter.Create(FileUtilities.GetTemporaryFile()));
     }
                                               );
 }
コード例 #5
0
 public void SaveReadOnly3()
 {
     Assert.Throws <InvalidOperationException>(() =>
     {
         var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);
         doc.Load(_pathToCommonTargets);
         doc.Save(new StringWriter());
     }
                                               );
 }