aboutsummaryrefslogtreecommitdiff
path: root/dotnet
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-04-26 21:59:32 +0100
committerMichael Williamson <mike@zwobble.org>2016-04-26 21:59:32 +0100
commit074bf195ebc0c59b1335983904ab0176996ceef5 (patch)
tree5d091d0efca5ff50878678a99ae899895bc9c645 /dotnet
parent83ab30b58328602eb233522b8dea8d2f13f11f13 (diff)
Add test for reading files with UTF-8 BOM
Diffstat (limited to 'dotnet')
-rw-r--r--dotnet/Mammoth.Tests/DocumentConverterTests.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/dotnet/Mammoth.Tests/DocumentConverterTests.cs b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
index 5b53685..adfd368 100644
--- a/dotnet/Mammoth.Tests/DocumentConverterTests.cs
+++ b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
@@ -6,16 +6,23 @@ namespace Mammoth.Tests {
[Fact]
public void DocxContainingOneParagraphIsConvertedToSingleParagraphElement() {
assertSuccessfulConversion(
- convertToHtml("single-paragraph.docx"),
+ ConvertToHtml("single-paragraph.docx"),
"<p>Walking on imported air</p>");
}
+ [Fact]
+ public void CanReadFilesWithUtf8Bom() {
+ assertSuccessfulConversion(
+ ConvertToHtml("utf8-bom.docx"),
+ "<p>This XML has a byte order mark.</p>");
+ }
+
private void assertSuccessfulConversion(IResult<string> result, string expectedValue) {
Assert.Empty(result.Warnings);
Assert.Equal(expectedValue, result.Value);
}
- private IResult<string> convertToHtml(string name) {
+ private IResult<string> ConvertToHtml(string name) {
return new DocumentConverter().ConvertToHtml(TestFilePath(name));
}