diff options
Diffstat (limited to 'dotnet/Mammoth.Tests/DocumentConverterTests.cs')
| -rw-r--r-- | dotnet/Mammoth.Tests/DocumentConverterTests.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/dotnet/Mammoth.Tests/DocumentConverterTests.cs b/dotnet/Mammoth.Tests/DocumentConverterTests.cs index 112087a..5b53685 100644 --- a/dotnet/Mammoth.Tests/DocumentConverterTests.cs +++ b/dotnet/Mammoth.Tests/DocumentConverterTests.cs @@ -1,5 +1,27 @@ -namespace Mammoth.Tests { +using Xunit; +using System.IO; + +namespace Mammoth.Tests { public class DocumentConverterTests { + [Fact] + public void DocxContainingOneParagraphIsConvertedToSingleParagraphElement() { + assertSuccessfulConversion( + convertToHtml("single-paragraph.docx"), + "<p>Walking on imported air</p>"); + } + + private void assertSuccessfulConversion(IResult<string> result, string expectedValue) { + Assert.Empty(result.Warnings); + Assert.Equal(expectedValue, result.Value); + } + + private IResult<string> convertToHtml(string name) { + return new DocumentConverter().ConvertToHtml(TestFilePath(name)); + } + + private string TestFilePath(string name) { + return Path.Combine("../../TestData", name); + } } } |
