From 83ab30b58328602eb233522b8dea8d2f13f11f13 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 26 Apr 2016 21:58:27 +0100 Subject: Add basic test --- dotnet/Mammoth.Tests/DocumentConverterTests.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'dotnet/Mammoth.Tests/DocumentConverterTests.cs') 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"), + "

Walking on imported air

"); + } + + private void assertSuccessfulConversion(IResult result, string expectedValue) { + Assert.Empty(result.Warnings); + Assert.Equal(expectedValue, result.Value); + } + + private IResult convertToHtml(string name) { + return new DocumentConverter().ConvertToHtml(TestFilePath(name)); + } + + private string TestFilePath(string name) { + return Path.Combine("../../TestData", name); + } } } -- cgit v1.2.3