FakeContentLoaderTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Content FakeContentLoaderTests

Namespace: DeltaEngine.Tests.Content
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class FakeContentLoaderTests

The FakeContentLoaderTests type exposes the following members.

Constructors

  NameDescription
Public methodFakeContentLoaderTests
Initializes a new instance of the FakeContentLoaderTests class
Top
Methods

  NameDescription
Public methodContentLoadWithNullStream
Public methodContentLoadWithWrongFilePath
Public methodCreateContentLoader
Public methodCreateDataIfAllowedAndNoContentFoundAndDispose
Public methodDisposeContentLoader
Public methodLoadDefaultDataIfAllowed
Public methodThrowExceptionIfSecondContentLoaderInstanceIsUsed
Top
Examples

[Test]
public void ContentLoadWithNullStream()
{
    ContentLoader.Load<DynamicXmlMockContent>("XmlContentWithNoPath");
}
[Test]
public void ContentLoadWithWrongFilePath()
{
    Assert.Throws<ContentLoader.ContentFileDoesNotExist>(
        () => ContentLoader.Load<XmlContent>("ContentWithWrongPath"));
}
[Test]
public void ThrowExceptionIfSecondContentLoaderInstanceIsUsed()
{
    ContentLoader.Exists("abc");
    Assert.Throws<ContentLoader.ContentLoaderAlreadyExistsItIsOnlyAllowedToSetBeforeTheAppStarts>(
        ContentLoader.Use<FakeContentLoader>);
}
[Test]
public void LoadDefaultDataIfAllowed()
{
    ContentLoader.Load<DynamicXmlMockContent>("UnavailableDynamicContent");
}
[Test]
public void CreateDataIfAllowedAndNoContentFoundAndDispose()
{
    var dummy = ContentLoader.Load<DynamicXmlMockContent>("Dummy");
    Assert.IsTrue(dummy.InternalAllowCreationIfContentNotFound);
    Assert.IsFalse(dummy.IsDisposed);
    dummy.Dispose();
    Assert.IsTrue(dummy.IsDisposed);
}
See Also