From 3d415ebd03de7b6f232d3091d3582bb005c6926c Mon Sep 17 00:00:00 2001 From: Emily Kho Date: Fri, 12 Apr 2024 15:36:41 +0200 Subject: [PATCH 1/2] added a few more tests --- .../XWPF/DocumentMapperTests/MapDocumentTests.cs | 10 +++++----- .../XWPF/ParagraphMapperTests/MapParagraphTests.cs | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NPOI.WordTemplateMapper.Tests/XWPF/DocumentMapperTests/MapDocumentTests.cs b/NPOI.WordTemplateMapper.Tests/XWPF/DocumentMapperTests/MapDocumentTests.cs index bb4271c..e39a962 100644 --- a/NPOI.WordTemplateMapper.Tests/XWPF/DocumentMapperTests/MapDocumentTests.cs +++ b/NPOI.WordTemplateMapper.Tests/XWPF/DocumentMapperTests/MapDocumentTests.cs @@ -19,11 +19,11 @@ public void ItShould_MapFullDocument() Mock tableRowMapperMock = new(); tableRowMapperMock -.Setup(t => t.MapDictionaryToRow( - It.IsAny(), - It.IsAny>() -)) -.Returns>((r, d) => r); + .Setup(t => t.MapDictionaryToRow( + It.IsAny(), + It.IsAny>() + )) + .Returns>((r, d) => r); tableRowMapperMock .Setup(t => t.MapEnumerableToRow( It.IsAny(), diff --git a/NPOI.WordTemplateMapper.Tests/XWPF/ParagraphMapperTests/MapParagraphTests.cs b/NPOI.WordTemplateMapper.Tests/XWPF/ParagraphMapperTests/MapParagraphTests.cs index 8acb0b8..e51108c 100644 --- a/NPOI.WordTemplateMapper.Tests/XWPF/ParagraphMapperTests/MapParagraphTests.cs +++ b/NPOI.WordTemplateMapper.Tests/XWPF/ParagraphMapperTests/MapParagraphTests.cs @@ -10,15 +10,18 @@ public class MapParagraphTests [Theory] [InlineData("{{A}} dolor sit amet", "lorem ipsum dolor sit amet")] [InlineData("{{B}} jumps over the lazy dog", "the quick brown fox jumps over the lazy dog")] + [InlineData("{{D}} at all\ntimes.", "The missile\nknows where\nit is at all\ntimes.\n")] [InlineData("", "")] [InlineData("ABCDEFG", "ABCDEFG")] + [InlineData("Hey guys\ndid you know\nvaporeon", "Hey guys\ndid you know\nvaporeon")] public void ItShould_MapParagraph(string paragraphText, string expecctedText) { Dictionary data = new() { { "{{A}}", "lorem ipsum" }, { "{{B}}", "the quick brown fox" }, - { "{{C}}", "het fikse aquaduct" } + { "{{C}}", "het fikse aquaduct" }, + { "{{D}}", "The missile\nknows where\nit is" }, }; CT_P ctParagraph = new(); From 8565fe613762b16aaa6a0a94d5ca4fa42a36f565 Mon Sep 17 00:00:00 2001 From: Emily Kho Date: Fri, 12 Apr 2024 15:43:01 +0200 Subject: [PATCH 2/2] net8 support --- .../NPOI.WordTemplateMapper.Interfaces.csproj | 4 ++-- .../NPOI.WordTemplateMapper.Tests.csproj | 2 +- NPOI.WordTemplateMapper/NPOI.WordTemplateMapper.csproj | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NPOI.WordTemplateMapper.Interfaces/NPOI.WordTemplateMapper.Interfaces.csproj b/NPOI.WordTemplateMapper.Interfaces/NPOI.WordTemplateMapper.Interfaces.csproj index f5d41c2..5a579b2 100644 --- a/NPOI.WordTemplateMapper.Interfaces/NPOI.WordTemplateMapper.Interfaces.csproj +++ b/NPOI.WordTemplateMapper.Interfaces/NPOI.WordTemplateMapper.Interfaces.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 enable enable True @@ -15,7 +15,7 @@ xwpfmapper-logo.png Apodemus.$(AssemblyName) Apodemus.$(AssemblyName) - 1.0.1 + 1.0.2 diff --git a/NPOI.WordTemplateMapper.Tests/NPOI.WordTemplateMapper.Tests.csproj b/NPOI.WordTemplateMapper.Tests/NPOI.WordTemplateMapper.Tests.csproj index 990a438..72413c4 100644 --- a/NPOI.WordTemplateMapper.Tests/NPOI.WordTemplateMapper.Tests.csproj +++ b/NPOI.WordTemplateMapper.Tests/NPOI.WordTemplateMapper.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0;net8.0 enable enable diff --git a/NPOI.WordTemplateMapper/NPOI.WordTemplateMapper.csproj b/NPOI.WordTemplateMapper/NPOI.WordTemplateMapper.csproj index 771e9be..77d1b30 100644 --- a/NPOI.WordTemplateMapper/NPOI.WordTemplateMapper.csproj +++ b/NPOI.WordTemplateMapper/NPOI.WordTemplateMapper.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 enable enable True @@ -16,7 +16,7 @@ README.md Apodemus.$(AssemblyName) Apodemus.$(AssemblyName) - 1.0.1 + 1.0.2