You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -184,5 +184,33 @@ namespace MonoTests.System.IO.Packaging {
|
||||
d.RelationshipType == node.Attributes["Type"].InnerText));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckRelationshipDeletion ()
|
||||
{
|
||||
AddThreeRelationShips ();
|
||||
package.Flush ();
|
||||
|
||||
foreach (PackageRelationship p in new List<PackageRelationship> (package.GetRelationships ()).Skip(1))
|
||||
package.DeleteRelationship (p.Id);
|
||||
|
||||
PackagePart part = package.GetPart (new Uri ("/_rels/.rels", UriKind.Relative));
|
||||
Assert.IsNotNull (package.GetPart (new Uri ("/_RELS/.RELS", UriKind.Relative)), "#0");
|
||||
package.Flush ();
|
||||
Assert.IsNotNull (part, "#1");
|
||||
|
||||
Stream stream = part.GetStream ();
|
||||
Assert.IsTrue (stream.Length > 0, "#2a");
|
||||
|
||||
XmlDocument doc = new XmlDocument ();
|
||||
XmlNamespaceManager manager = new XmlNamespaceManager (doc.NameTable);
|
||||
manager.AddNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
doc.Load (new StreamReader (stream));
|
||||
|
||||
Assert.IsNotNull (doc.SelectSingleNode ("/rel:Relationships", manager), "#2b");
|
||||
|
||||
XmlNodeList list = doc.SelectNodes ("/rel:Relationships/*", manager);
|
||||
Assert.AreEqual (1, list.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user