ContentData InternalCreateDefault Method Delta Engine Documentation

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

public void InternalCreateDefault()
Remarks

Tests: DeltaEngine.Content.Xml.Tests.InputCommandsTests
Examples

2 unit tests call DeltaEngine.Content.ContentData.InternalCreateDefault
[Test, CloseAfterFirstFrame]
public void LogErrorIfTriggerTypeDoesNotExist()
{
    var logger = new MockLogger();
    Assert.Throws<Command.UnableToRegisterCommandWithoutTriggers>(
        () =>
            ContentLoader.Load<NoDataInputCommands>("NoDataInputCommands").InternalCreateDefault());
    Assert.IsTrue(logger.LastMessage.Contains(NonTriggerTypeName), logger.LastMessage);
    Assert.IsTrue(logger.LastMessage.Contains("MissingMethodException"), logger.LastMessage);
    logger.Dispose();
}
[Test, CloseAfterFirstFrame, Timeout(5000)]
public void CreateDefaultInputCommandsIfContentNotFound()
{
    var inputCommands = ContentLoader.Load<NotExistingInputCommands>("NotExistingInputCommands");
    inputCommands.InternalCreateDefault();
    foreach (var commandData in inputCommands.Data.Children)
    {
        Assert.IsNotEmpty(commandData.Name);
        Assert.IsNull(commandData.Value);
    }
    var exitCommand = new Command(Command.Exit, (Action)null);
    List<Trigger> triggers = exitCommand.GetTriggers();
    Assert.AreEqual(1, triggers.Count);
    Assert.AreEqual("KeyTrigger", triggers[0].GetShortNameOrFullNameIfNotFound());
}
See Also