From 47a53a67199033258a953cc5b71981328eab7e49 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 28 Apr 2016 22:07:05 +0100 Subject: Enable AddStyleMap --- dotnet/Mammoth.Tests/DocumentConverterTests.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dotnet/Mammoth.Tests') 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 { "

Datum plane

"); } + [Fact] + public void CanUseCustomStyleMap() { + AssertSuccessfulConversion( + ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em")), + "

The Sunset Tree

"); + } + + [Fact] + public void MostRecentlyAddedStyleMapTakesPrecedence() { + AssertSuccessfulConversion( + ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em").AddStyleMap("u => strong")), + "

The Sunset Tree

"); + } + + [Fact] + public void RulesFromPreviouslyAddedStyleMapsStillTakeEffectIfNotOverriden() { + AssertSuccessfulConversion( + ConvertToHtml("underline.docx", mammoth => mammoth.AddStyleMap("u => em").AddStyleMap("strike => del")), + "

The Sunset Tree

"); + } + [Fact] public void CanExtractRawTextFromFile() { AssertSuccessfulConversion( -- cgit v1.2.3