ContentTypeIdentifier ExtensionToType Method Delta Engine Documentation

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

public static ContentType ExtensionToType(
	string filename
)

Return Value

Type: ContentType
Remarks

Tests: DeltaEngine.Content.Xml.Tests.ContentTypeIdentifierTests
Examples

2 unit tests call DeltaEngine.Content.Xml.ContentTypeIdentifier.ExtensionToType(System.String)
[Test]
public void UnsupportedTypeLogsAndThrowsExceptionInDebug()
{
    Assert.Throws<ContentTypeIdentifier.UnsupportedContentFileFoundCannotParseType>(
        () => ContentTypeIdentifier.ExtensionToType(UnsupportedFileName));
}
[Test]
public void UnsupportedTypeReturnsJustStoreInRelease()
{
    Assert.AreEqual(ContentType.JustStore,
        ContentTypeIdentifier.ExtensionToType(UnsupportedFileName));
}
See Also