Confirms XmlContent can load from file
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content.Xml.Tests XmlContentTests
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 XmlContentTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
XmlContentTests | Initializes a new instance of the XmlContentTests class |
Methods
Name | Description | |
---|---|---|
CreateMockContentLoader | ||
DisposeMockContentLoader | ||
LoadXmlContentFromFile | ||
LoadXmlContentFromMock | ||
LoadXmlContentFromNonExistingFile |
Examples
[Test] public void LoadXmlContentFromMock() { var xmlContent = ContentLoader.Load<XmlContent>("Test"); Assert.False(xmlContent.IsDisposed); Assert.AreEqual("Root", xmlContent.Data.Name); Assert.AreEqual(1, xmlContent.Data.Children.Count); Assert.AreEqual("Hi", xmlContent.Data.Children[0].Name); xmlContent.Dispose(); }
[Test] public void LoadXmlContentFromNonExistingFile() { var xmlContent = ContentLoader.Load<XmlContent>("NonExisting"); Assert.AreEqual("NonExisting", xmlContent.Data.Name); }
[Test, Category("Slow"), Ignore] public void LoadXmlContentFromFile() { var xmlContent = ContentLoader.Load<XmlContent>("Test"); Assert.False(xmlContent.IsDisposed); Assert.AreEqual("Root", xmlContent.Data.Name); Assert.AreEqual(1, xmlContent.Data.Children.Count); Assert.AreEqual("Hi", xmlContent.Data.Children[0].Name); }
See Also