aboutsummaryrefslogtreecommitdiff
path: root/dotnet/Mammoth.Tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-04-28 22:07:05 +0100
committerMichael Williamson <mike@zwobble.org>2016-04-28 22:07:05 +0100
commit47a53a67199033258a953cc5b71981328eab7e49 (patch)
tree71e76e047e4cb1be9a26b55305d5049c9e00cbad /dotnet/Mammoth.Tests
parent4caa94950ef6c53d109e83172270160419225495 (diff)
Enable AddStyleMap
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(