ContentTypeIdentifier ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Content.Xml ContentTypeIdentifier

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

public class ContentTypeIdentifier

The ContentTypeIdentifier type exposes the following members.

Constructors

  NameDescription
Public methodContentTypeIdentifier
Initializes a new instance of the ContentTypeIdentifier class
Top
Methods

  NameDescription
Public methodStatic memberDetermineTypeForXmlFile
Public methodStatic memberExtensionToType
Public methodStatic memberIsUncompressedFile
Top
Remarks

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

6 unit tests call DeltaEngine.Content.Xml.ContentTypeIdentifier
[Test]
public void ContentTypeOfUndefinedRootElementsIsXml()
{
    string xmlData = CreateXmlDataFromTag("Test");
    ContentType type = GetContentTypeOfXmlData(xmlData);
    Assert.AreEqual(ContentType.Xml, type);
}
[Test]
public void ThrowExceptionIfInvalidXmlData()
{
    const string InvalidXmlData = "<Opening></Closing>";
    Assert.Throws<XmlException>(() => GetContentTypeOfXmlData(InvalidXmlData));
}
[Test]
public void UnsupportedTypeLogsAndThrowsExceptionInDebug()
{
    Assert.Throws<ContentTypeIdentifier.UnsupportedContentFileFoundCannotParseType>(
        () => ContentTypeIdentifier.ExtensionToType(UnsupportedFileName));
}
See Also