Browse Source

Updated tests project

flabbet 8 months ago
parent
commit
9fb9f4e75e

+ 1 - 1
src/PixiDocks

@@ -1 +1 @@
-Subproject commit f9bdb75115d1152a5126706bc8dc2098f72decde
+Subproject commit 4bde0473756a8a08895e2108bf9919b852b16c34

+ 3 - 3
tests/ChunkyImageLibTest/ChunkyImageLibTest.csproj

@@ -7,9 +7,9 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
-    <PackageReference Include="xunit" Version="2.4.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
+    <PackageReference Include="xunit" Version="2.9.2" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>

+ 19 - 6
tests/ChunkyImageLibTest/RectangleOperationTests.cs

@@ -1,8 +1,10 @@
 using System.Collections.Generic;
 using ChunkyImageLib;
 using ChunkyImageLib.Operations;
+using Drawie.Backend.Core.Bridge;
 using Drawie.Backend.Core.ColorsImpl;
 using Drawie.Numerics;
+using Drawie.Skia;
 using Xunit;
 
 namespace ChunkyImageLibTest;
@@ -10,6 +12,16 @@ namespace ChunkyImageLibTest;
 public class RectangleOperationTests
 {
     const int chunkSize = ChunkPool.FullChunkSize;
+    public RectangleOperationTests()
+    {
+        try
+        {
+            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend(), null);
+        }
+        catch
+        {
+        }
+    }
 // to keep expected rectangles aligned
 #pragma warning disable format
     [Fact]
@@ -45,7 +57,7 @@ public class RectangleOperationTests
         HashSet<VecI> expected = new()
         {
             new(1, 1), new(2, 1), new(3, 1),
-            new(1, 2),            new(3, 2),
+            new(1, 2), new(3, 2),
             new(1, 3), new(2, 3), new(3, 3),
         };
         var actual = operation.FindAffectedArea(new(chunkSize)).Chunks;
@@ -56,13 +68,14 @@ public class RectangleOperationTests
     [Fact]
     public void FindAffectedArea_3x3NegativeStrokeOnly_FindsCorrectChunks()
     {
-        var (x, y, w, h) = (-chunkSize * 2 - chunkSize / 2, -chunkSize * 2 - chunkSize / 2, chunkSize * 2, chunkSize * 2);
+        var (x, y, w, h) = (-chunkSize * 2 - chunkSize / 2, -chunkSize * 2 - chunkSize / 2, chunkSize * 2,
+            chunkSize * 2);
         RectangleOperation operation = new(new(new(x, y), new(w, h), 0, 1, Colors.Black, Colors.Transparent));
 
         HashSet<VecI> expected = new()
         {
             new(-4, -4), new(-3, -4), new(-2, -4),
-            new(-4, -3),              new(-2, -3),
+            new(-4, -3), new(-2, -3),
             new(-4, -2), new(-3, -2), new(-2, -2),
         };
         var actual = operation.FindAffectedArea(new(chunkSize)).Chunks;
@@ -78,7 +91,7 @@ public class RectangleOperationTests
 
         HashSet<VecI> expected = new()
         {
-            new(1, 1), new(2, 1), new(3, 1), 
+            new(1, 1), new(2, 1), new(3, 1),
             new(1, 2), new(2, 2), new(3, 2),
             new(1, 3), new(2, 3), new(3, 3),
         };
@@ -97,7 +110,7 @@ public class RectangleOperationTests
         {
             new(0, 0), new(1, 0), new(2, 0), new(3, 0), new(4, 0),
             new(0, 1), new(1, 1), new(2, 1), new(3, 1), new(4, 1),
-            new(0, 2), new(1, 2),            new(3, 2), new(4, 2),
+            new(0, 2), new(1, 2), new(3, 2), new(4, 2),
             new(0, 3), new(1, 3), new(2, 3), new(3, 3), new(4, 3),
             new(0, 4), new(1, 4), new(2, 4), new(3, 4), new(4, 4),
         };
@@ -118,4 +131,4 @@ public class RectangleOperationTests
         Assert.Equal(expected, actual);
     }
 #pragma warning restore format
-}
+}

+ 11 - 5
tests/PixiEditor.Api.CGlueMSBuild.Tests/PixiEditor.Api.CGlueMSBuild.Tests.csproj

@@ -9,11 +9,17 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="coverlet.collector" Version="6.0.0"/>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
-    <PackageReference Include="Mono.Cecil" Version="0.11.5"/>
-    <PackageReference Include="xunit" Version="2.5.3"/>
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3"/>
+    <PackageReference Include="coverlet.collector" Version="6.0.2">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
+    <PackageReference Include="Mono.Cecil" Version="0.11.6" />
+    <PackageReference Include="xunit" Version="2.9.2" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
   </ItemGroup>
 
 

+ 1 - 0
tests/PixiEditor.Backend.Tests/MockDocument.cs

@@ -13,6 +13,7 @@ public class MockDocument : IReadOnlyDocument
         throw new NotImplementedException();
     }
 
+    public Guid DocumentId { get; }
     public IReadOnlyNodeGraph NodeGraph { get; }
     public IReadOnlySelection Selection { get; }
     public IReadOnlyAnimationData AnimationData { get; }

+ 10 - 4
tests/PixiEditor.Backend.Tests/PixiEditor.Backend.Tests.csproj

@@ -10,10 +10,16 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="coverlet.collector" Version="6.0.0"/>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
-        <PackageReference Include="xunit" Version="2.5.3"/>
-        <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3"/>
+        <PackageReference Include="coverlet.collector" Version="6.0.2">
+          <PrivateAssets>all</PrivateAssets>
+          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+        </PackageReference>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
+        <PackageReference Include="xunit" Version="2.9.2" />
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
+          <PrivateAssets>all</PrivateAssets>
+          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+        </PackageReference>
     </ItemGroup>
 
     <ItemGroup>

+ 4 - 4
tests/PixiEditor.Extensions.Sdk.Tests/PixiEditor.Extensions.Sdk.Tests.csproj

@@ -10,13 +10,13 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.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.11.1" />
+        <PackageReference Include="xunit" Version="2.9.2" />
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>
-        <PackageReference Include="coverlet.collector" Version="6.0.0">
+        <PackageReference Include="coverlet.collector" Version="6.0.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>

+ 4 - 4
tests/PixiEditor.Extensions.Tests/PixiEditor.Extensions.Tests.csproj

@@ -11,13 +11,13 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.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.11.1" />
+        <PackageReference Include="xunit" Version="2.9.2" />
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>
-        <PackageReference Include="coverlet.collector" Version="6.0.0">
+        <PackageReference Include="coverlet.collector" Version="6.0.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>

+ 4 - 4
tests/PixiEditor.Extensions.WasmRuntime.Tests/PixiEditor.Extensions.WasmRuntime.Tests.csproj

@@ -10,13 +10,13 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.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.11.1" />
+        <PackageReference Include="xunit" Version="2.9.2" />
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>
-        <PackageReference Include="coverlet.collector" Version="6.0.0">
+        <PackageReference Include="coverlet.collector" Version="6.0.2">
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
             <PrivateAssets>all</PrivateAssets>
         </PackageReference>

+ 5 - 5
tests/PixiEditor.Tests/PixiEditor.Tests.csproj

@@ -11,14 +11,14 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Avalonia" Version="11.1.4" />
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
-        <PackageReference Include="xunit" Version="2.4.2"/>
-        <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
+        <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
+        <PackageReference Include="xunit" Version="2.9.2"/>
+        <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
             <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>