SceneTests LoadingDisposedSceneRecreatesIt Method Delta Engine Documentation

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

public void LoadingDisposedSceneRecreatesIt()
Examples

[Test, CloseAfterFirstFrame]
public void LoadingDisposedSceneRecreatesIt()
{
    var loadedScene = ContentLoader.Load<Scene>("SceneWithAButton");
    loadedScene.Dispose();
    loadedScene = ContentLoader.Load<Scene>("SceneWithAButton");
    Assert.AreEqual(1, loadedScene.Controls.Count);
    Assert.IsTrue(loadedScene.Controls[0].IsActive);
}
See Also