XmlContentTests ClassDelta Engine Documentation
Confirms XmlContent can load from file View code on GitHub
Inheritance Hierarchy

System Object
  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

public class XmlContentTests

The XmlContentTests type exposes the following members.

Constructors

  NameDescription
Public methodXmlContentTests
Initializes a new instance of the XmlContentTests class
Top
Methods

  NameDescription
Public methodCreateMockContentLoader
Public methodDisposeMockContentLoader
Public methodLoadXmlContentFromFile
Public methodLoadXmlContentFromMock
Public methodLoadXmlContentFromNonExistingFile
Top
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