5 Commits 04db6c872b ... 36bcd8ca60

Author SHA1 Message Date
  Piotr Czajkowski 36bcd8ca60 "Better" test 6 months ago
  Piotr Czajkowski 1a2ed3781a Updated dependencies 6 months ago
  Piotr Czajkowski fff59768b9 Update dotnet.yml 6 months ago
  Piotr Czajkowski d340201ed3 Added working dir 6 months ago
  Piotr Czajkowski 3fa3804e4b Create dotnet.yml 6 months ago

+ 31 - 0
.github/workflows/dotnet.yml

@@ -0,0 +1,31 @@
+# This workflow will build a .NET project
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
+
+name: .NET
+
+on:
+  push:
+    branches: [ "main" ]
+  pull_request:
+    branches: [ "main" ]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v4
+    - name: Setup .NET
+      uses: actions/setup-dotnet@v4
+      with:
+        dotnet-version: 7.0.x
+    - name: Restore dependencies
+      run: dotnet restore
+      working-directory: ExcelORM
+    - name: Build
+      run: dotnet build --no-restore
+      working-directory: ExcelORM
+    - name: Test
+      run: dotnet test --no-build --verbosity normal
+      working-directory: ExcelORM

+ 1 - 1
ExcelORM/ExcelORM/ExcelORM.csproj

@@ -18,7 +18,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-	    <PackageReference Include="ClosedXML" Version="0.102.1" />
+	    <PackageReference Include="ClosedXML" Version="0.102.2" />
 	    <None Include="../../README.md" Pack="true" PackagePath="\" />
 	    <None Include="../../LICENSE" Pack="true" PackagePath="" />
     </ItemGroup>

+ 4 - 4
ExcelORM/ExcelORMTests/ExcelORMTests.csproj

@@ -10,13 +10,13 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
-        <PackageReference Include="xunit" Version="2.4.2" />
-        <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
+        <PackageReference Include="xunit" Version="2.8.0" />
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>
-        <PackageReference Include="coverlet.collector" Version="3.2.0">
+        <PackageReference Include="coverlet.collector" Version="6.0.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>

+ 3 - 2
ExcelORM/ExcelORMTests/WriterTests.cs

@@ -73,7 +73,7 @@ public class WriterTests
         var expected = new TestTypes
         {
             Date = DateTime.Now,
-            TimeSpan = TimeSpan.MaxValue,
+            TimeSpan = TimeSpan.FromSeconds(360),
             Double = 2.33,
             Int = 1024,
             Text = "Test"
@@ -90,7 +90,8 @@ public class WriterTests
         Assert.Single(result);
         var first = result.First();
         Assert.Equal(expected.Date.ToString(), first.Date.ToString());
-        Assert.Equal(expected.TimeSpan, first.TimeSpan);
+        Assert.NotNull(first.TimeSpan);
+        Assert.Equal(expected.TimeSpan.Value.Minutes, first.TimeSpan.Value.Minutes);
         Assert.Equal(expected.Double, first.Double);
         Assert.Equal(expected.Int, first.Int);
         Assert.Equal(expected.Text, first.Text);