Inheritance Hierarchy
DeltaEngine.Content.Xml.Tests XmlFileTests
Namespace: DeltaEngine.Content.Xml.Tests
Assembly: DeltaEngine.Content.Xml.Tests (in DeltaEngine.Content.Xml.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The XmlFileTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
XmlFileTests | Initializes a new instance of the XmlFileTests class |
Methods
Name | Description | |
---|---|---|
LoadXmlFromStream | ||
SavingAndLoadingLeavesItUnchanged | ||
XmlDataConstructor |
Examples
[Test] public void XmlDataConstructor() { var data = new XmlData("name"); var file = new XmlFile(data); Assert.AreEqual(data, file.Root); }
[Test] public void LoadXmlFromStream() { var memoryStream = new MemoryStream(); var writer = new BinaryWriter(memoryStream); writer.Write(new XmlData("MyData").ToString()); memoryStream.Seek(0, SeekOrigin.Begin); var file = new XmlFile(memoryStream); Assert.AreEqual("MyData", file.Root.Name); }
[Test] public void SavingAndLoadingLeavesItUnchanged() { XmlData data = CreateTestXmlData(); var file = new XmlFile(data); file.Save("file.xml"); XmlData loaded = new XmlFile("file.xml").Root; Assert.AreEqual(data.ToString(), loaded.ToString()); }
See Also