aboutsummaryrefslogtreecommitdiff
path: root/dotnet/Mammoth.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'dotnet/Mammoth.Tests')
-rw-r--r--dotnet/Mammoth.Tests/DocumentConverterTests.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/dotnet/Mammoth.Tests/DocumentConverterTests.cs b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
index 8f34fea..8788b9d 100644
--- a/dotnet/Mammoth.Tests/DocumentConverterTests.cs
+++ b/dotnet/Mammoth.Tests/DocumentConverterTests.cs
@@ -115,6 +115,27 @@ namespace Mammoth.Tests {
"<p>Datum plane</p>");
}
+ [Fact]
+ public void CanUseCustomStyleMap() {
+ AssertSuccessfulConversion(
+ ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em")),
+ "<p><strong>The <em>Sunset</em> Tree</strong></p>");
+ }
+
+ [Fact]
+ public void MostRecentlyAddedStyleMapTakesPrecedence() {
+ AssertSuccessfulConversion(
+ ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em").AddStyleMap("u => strong")),
+ "<p><strong>The <strong>Sunset</strong> Tree</strong></p>");
+ }
+
+ [Fact]
+ public void RulesFromPreviouslyAddedStyleMapsStillTakeEffectIfNotOverriden() {
+ AssertSuccessfulConversion(
+ ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em").AddStyleMap("strike => del")),
+ "<p><strong>The <em>Sunset</em> Tree</strong></p>");
+ }
+
[Fact]
public void CanExtractRawTextFromFile() {
AssertSuccessfulConversion(