diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-04-26 21:58:27 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-04-26 21:58:27 +0100 |
| commit | 83ab30b58328602eb233522b8dea8d2f13f11f13 (patch) | |
| tree | 553e1077d79e7c282540b665e0620ca0f2d63052 /dotnet/Mammoth.Tests/DocumentConverterTests.cs | |
| parent | 73a6878e1869a2f742bba15364459ae0eea45962 (diff) | |
Add basic test
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); + } } } |
