aboutsummaryrefslogtreecommitdiff
path: root/Mammoth.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Mammoth.Tests')
-rw-r--r--Mammoth.Tests/DocumentConverterTests.cs8
-rw-r--r--Mammoth.Tests/Mammoth.Tests.csproj3
-rw-r--r--Mammoth.Tests/TestDocuments/unrecognised-paragraph-styles.docxbin0 -> 3400 bytes
3 files changed, 11 insertions, 0 deletions
diff --git a/Mammoth.Tests/DocumentConverterTests.cs b/Mammoth.Tests/DocumentConverterTests.cs
index 9a977c5..37cec23 100644
--- a/Mammoth.Tests/DocumentConverterTests.cs
+++ b/Mammoth.Tests/DocumentConverterTests.cs
@@ -12,5 +12,13 @@ namespace Mammoth.Tests
Assert.AreEqual("<p>Walking on imported air</p>", result.Value);
Assert.IsEmpty(result.Messages);
}
+
+ [Test]
+ public void UnrecognisedStylesAreStatedInMessages()
+ {
+ var documentConverter = new DocumentConverter();
+ var result = documentConverter.ConvertToHtml("TestDocuments/unrecognised-paragraph-styles.docx");
+ Assert.AreEqual("Unrecognised paragraph style: 'Funky' (Style ID: style20)", result.Messages[0].Value);
+ }
}
}
diff --git a/Mammoth.Tests/Mammoth.Tests.csproj b/Mammoth.Tests/Mammoth.Tests.csproj
index 963e64c..212db46 100644
--- a/Mammoth.Tests/Mammoth.Tests.csproj
+++ b/Mammoth.Tests/Mammoth.Tests.csproj
@@ -68,6 +68,9 @@
<None Include="TestDocuments\single-paragraph.docx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="TestDocuments\unrecognised-paragraph-styles.docx">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mammoth\Mammoth.csproj">
diff --git a/Mammoth.Tests/TestDocuments/unrecognised-paragraph-styles.docx b/Mammoth.Tests/TestDocuments/unrecognised-paragraph-styles.docx
new file mode 100644
index 0000000..ad4064f
--- /dev/null
+++ b/Mammoth.Tests/TestDocuments/unrecognised-paragraph-styles.docx
Binary files differ