Inheritance Hierarchy
DeltaEngine.Content.Xml.Tests ContentTypeIdentifierTests
Namespace: DeltaEngine.Content.Xml.Tests
Assembly: DeltaEngine.Content.Xml.Tests (in DeltaEngine.Content.Xml.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ContentTypeIdentifierTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ContentTypeIdentifierTests | Initializes a new instance of the ContentTypeIdentifierTests class |
Methods
Examples
[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)); }
[Test] public void UnsupportedTypeReturnsJustStoreInRelease() { Assert.AreEqual(ContentType.JustStore, ContentTypeIdentifier.ExtensionToType(UnsupportedFileName)); }
[Test] public void CheckExtensionOfLocalFilePathIfUsingCompressedOrUncompressedFileFormat() { Assert.IsFalse(ContentTypeIdentifier.IsUncompressedFile("Image.jpg")); Assert.IsTrue(ContentTypeIdentifier.IsUncompressedFile("TextDocument.txt")); }
[Test] public void CheckNonExistingFilePathShouldReturnUncompressedFile() { Assert.IsTrue(ContentTypeIdentifier.IsUncompressedFile("")); Assert.IsTrue(ContentTypeIdentifier.IsUncompressedFile(null)); }
See Also