diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0bc7c9d..5a64d4d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -22,4 +22,4 @@ jobs: - name: Build run: dotnet build --no-restore Npoi.Mapper/Npoi.Mapper.sln - name: Test - run: dotnet test --no-build --verbosity normal Npoi.Mapper/Npoi.Mapper.sln + run: dotnet test --framework net6.0 --no-build --verbosity normal Npoi.Mapper/Npoi.Mapper.sln diff --git a/Npoi.Mapper/src/Npoi.Mapper/Npoi.Mapper.csproj b/Npoi.Mapper/src/Npoi.Mapper/Npoi.Mapper.csproj index 7ddbfdb..8440304 100644 --- a/Npoi.Mapper/src/Npoi.Mapper/Npoi.Mapper.csproj +++ b/Npoi.Mapper/src/Npoi.Mapper/Npoi.Mapper.csproj @@ -5,14 +5,14 @@ Donny Tian Npoi.Mapper Npoi.Mapper - Excel;XLS;XLSX;NPOI;Object mapping;dynamic + Excel;XLS;XLSX;NPOI;object mapping;dynamic object mapping https://donnytian.github.io/Npoi.Mapper/ True - 6.0 - Target on net6.0 only + 6.1 + Support net 472 and net60 true npoi.mapper.snk - net6.0 + net472;net6.0 default @@ -30,7 +30,7 @@ - + diff --git a/Npoi.Mapper/test/ExportGeneralTests.cs b/Npoi.Mapper/test/ExportGeneralTests.cs index 4a4a440..a4724a0 100644 --- a/Npoi.Mapper/test/ExportGeneralTests.cs +++ b/Npoi.Mapper/test/ExportGeneralTests.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using Npoi.Mapper; -using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using NUnit.Framework; diff --git a/Npoi.Mapper/test/Extensions.cs b/Npoi.Mapper/test/Extensions.cs index e615d07..3206ca0 100644 --- a/Npoi.Mapper/test/Extensions.cs +++ b/Npoi.Mapper/test/Extensions.cs @@ -1,5 +1,4 @@ using System; -using NUnit.Framework; namespace test { diff --git a/Npoi.Mapper/test/ImportDynamicTests.cs b/Npoi.Mapper/test/ImportDynamicTests.cs index deff777..afcb2c4 100644 --- a/Npoi.Mapper/test/ImportDynamicTests.cs +++ b/Npoi.Mapper/test/ImportDynamicTests.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Npoi.Mapper; using NPOI.SS.UserModel; using NUnit.Framework; @@ -275,7 +272,9 @@ public void TakeDynamic_TwoSheets_WithSameHeaderName() Assert.AreEqual(stringValue, objs1[0].Value.A); Assert.AreEqual(intValue, objs1[0].Value.sheet1B); Assert.AreEqual(doubleValue, objs2[0].Value.A); - Assert.AreEqual(dateTimeValue.ToOADate(), objs2[0].Value.sheet2B); + var diff = dateTimeValue.ToOADate() - objs2[0].Value.sheet2B; + const double epsilon = 0.0000000001; + Assert.IsTrue(Math.Abs(diff) < epsilon); } } } diff --git a/Npoi.Mapper/test/ImportGeneralTests.cs b/Npoi.Mapper/test/ImportGeneralTests.cs index ff4edd5..7a8a948 100644 --- a/Npoi.Mapper/test/ImportGeneralTests.cs +++ b/Npoi.Mapper/test/ImportGeneralTests.cs @@ -3,7 +3,6 @@ using System.Globalization; using System.IO; using System.Linq; -using NPOI.HSSF.UserModel; using Npoi.Mapper; using Npoi.Mapper.Attributes; using NPOI.SS.UserModel; diff --git a/Npoi.Mapper/test/TestSetUp.cs b/Npoi.Mapper/test/TestSetUp.cs index a78489b..fa52b7c 100644 --- a/Npoi.Mapper/test/TestSetUp.cs +++ b/Npoi.Mapper/test/TestSetUp.cs @@ -1,9 +1,6 @@ using System; -using System.Diagnostics.CodeAnalysis; using NUnit.Framework; -[assembly:ExcludeFromCodeCoverage] - namespace test { /// diff --git a/Npoi.Mapper/test/test.csproj b/Npoi.Mapper/test/test.csproj index a39af85..8c19072 100644 --- a/Npoi.Mapper/test/test.csproj +++ b/Npoi.Mapper/test/test.csproj @@ -1,7 +1,7 @@  - net6.0 + net472;net6.0 default @@ -16,7 +16,7 @@ - + all @@ -28,12 +28,7 @@ - - - - - - + @@ -42,7 +37,7 @@ - + Always