Sfoglia il codice sorgente

Fixed tests solution

flabbet 1 anno fa
parent
commit
32dfeb0fbb

BIN
src/PixiEditor.Extensions.Sdk/build/PixiEditor.Api.CGlueMSBuild.dll


+ 2 - 2
tests/ChunkyImageLibTest/ChunkyImageTests.cs

@@ -16,7 +16,7 @@ public class ChunkyImageTests
     {
         try
         {
-            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend());
+            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend(), null);
         }
         catch { }
     }
@@ -24,7 +24,7 @@ public class ChunkyImageTests
     [Fact]
     public void Dispose_ComplexImage_ReturnsAllChunks()
     {
-        ChunkyImage image = new ChunkyImage(new(ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize));
+        ChunkyImage image = new ChunkyImage(new VecI(ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize));
         image.EnqueueDrawRectangle(new(new(5, 5), new(80, 80), 0, 2, Colors.AliceBlue, Colors.Snow));
         using (Chunk target = Chunk.Create())
         {

+ 1 - 1
tests/ChunkyImageLibTest/ImageOperationTests.cs

@@ -16,7 +16,7 @@ public class ImageOperationTests
     {
         try
         {
-            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend());
+            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend(), null);
         }
         catch { }
     }

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

@@ -1,5 +1,6 @@
 using PixiEditor.ChangeableDocument.Changeables.Graph.Interfaces;
 using PixiEditor.ChangeableDocument.Changeables.Interfaces;
+using PixiEditor.ChangeableDocument.Rendering;
 using PixiEditor.DrawingApi.Core.Surfaces.ImageData;
 using PixiEditor.Numerics;
 
@@ -60,6 +61,11 @@ public class MockDocument : IReadOnlyDocument
         throw new NotImplementedException();
     }
 
+    (IReadOnlyStructureNode, IReadOnlyNode) IReadOnlyDocument.FindChildAndParentOrThrow(Guid childGuid)
+    {
+        return FindChildAndParentOrThrow(childGuid);
+    }
+
     public (IReadOnlyStructureNode, IReadOnlyFolderNode) FindChildAndParentOrThrow(Guid childGuid)
     {
         throw new NotImplementedException();
@@ -71,4 +77,5 @@ public class MockDocument : IReadOnlyDocument
     }
 
     public IReadOnlyReferenceLayer? ReferenceLayer { get; }
+    public DocumentRenderer Renderer { get; }
 }

+ 5 - 9
tests/PixiEditor.Backend.Tests/NodeSystemTests.cs

@@ -1,11 +1,5 @@
-using System.Collections.Immutable;
 using System.Reflection;
-using ChunkyImageLib;
 using ChunkyImageLib.DataHolders;
-using PixiEditor.AvaloniaUI.Helpers;
-using PixiEditor.AvaloniaUI.Models.Serialization;
-using PixiEditor.AvaloniaUI.Models.Serialization.Factories;
-using PixiEditor.ChangeableDocument.Changeables.Animations;
 using PixiEditor.ChangeableDocument.Changeables.Graph;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Nodes;
 using PixiEditor.ChangeableDocument.Changeables.Interfaces;
@@ -13,10 +7,12 @@ using PixiEditor.ChangeableDocument.Changes.NodeGraph;
 using PixiEditor.ChangeableDocument.Rendering;
 using PixiEditor.DrawingApi.Core.Bridge;
 using PixiEditor.DrawingApi.Skia;
+using PixiEditor.Models.Serialization;
+using PixiEditor.Models.Serialization.Factories;
 using PixiEditor.Numerics;
 using PixiEditor.Parser.Skia.Encoders;
+using PixiEditor.Views.Rendering;
 using Xunit.Abstractions;
-using Xunit.Sdk;
 
 namespace PixiEditor.Backend.Tests;
 
@@ -33,7 +29,7 @@ public class NodeSystemTests
     {
         this.output = output;
         if (!DrawingBackendApi.HasBackend)
-            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend());
+            DrawingBackendApi.SetupBackend(new SkiaDrawingBackend(), new AvaloniaRenderingServer());
     }
 
     [Fact]
@@ -95,7 +91,7 @@ public class NodeSystemTests
         foreach (var type in pairs)
         {
             var startNode = NodeOperations.CreateNode(type.Key, target);
-            var endNode = NodeOperations.CreateNode(type.Value, target, startNode);
+            var endNode = NodeOperations.CreateNode(type.Value, target);
 
             Assert.NotNull(startNode);
             Assert.NotNull(endNode);

+ 1 - 1
tests/PixiEditor.Backend.Tests/PixiEditor.Backend.Tests.csproj

@@ -21,7 +21,7 @@
     </ItemGroup>
 
     <ItemGroup>
-      <ProjectReference Include="..\..\src\PixiEditor.AvaloniaUI\PixiEditor.AvaloniaUI.csproj" />
+      <ProjectReference Include="..\..\src\PixiEditor\PixiEditor.csproj" />
       <ProjectReference Include="..\..\src\PixiEditor.ChangeableDocument\PixiEditor.ChangeableDocument.csproj" />
       <ProjectReference Include="..\..\src\PixiEditor.DrawingApi.Skia\PixiEditor.DrawingApi.Skia.csproj" />
     </ItemGroup>

+ 1 - 1
tests/PixiEditor.Tests/AvaloniaTestRunner.cs

@@ -2,7 +2,7 @@
 using Avalonia.Headless;
 using Avalonia.Platform;
 using Avalonia.Threading;
-using PixiEditor.Avalonia.Desktop;
+using PixiEditor.Desktop;
 using Xunit.Abstractions;
 using Xunit.Sdk;
 

+ 1 - 2
tests/PixiEditor.Tests/FramebufferExtensionTests.cs

@@ -2,8 +2,7 @@ using Avalonia;
 using Avalonia.Media;
 using Avalonia.Media.Imaging;
 using Avalonia.Platform;
-using PixiEditor.AvaloniaUI.Helpers.Extensions;
-using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.Helpers.Extensions;
 using PixiEditor.Numerics;
 
 namespace PixiEditor.Tests;

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

@@ -11,7 +11,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Avalonia" Version="11.1.0" />
+        <PackageReference Include="Avalonia" Version="11.1.3" />
         <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">
@@ -26,7 +26,7 @@
 
 
     <ItemGroup>
-      <ProjectReference Include="..\..\src\PixiEditor.AvaloniaUI.Desktop\PixiEditor.AvaloniaUI.Desktop.csproj" />
+      <ProjectReference Include="..\..\src\PixiEditor.Desktop\PixiEditor.Desktop.csproj" />
     </ItemGroup>
 
 </Project>

+ 2 - 3
tests/PixiEditor.Tests/WriteableBitmapUtilityTests.cs

@@ -1,9 +1,8 @@
 using Avalonia.Media;
 using Avalonia.Media.Imaging;
 using Avalonia.Platform;
-using PixiEditor.AvaloniaUI.Helpers;
-using PixiEditor.AvaloniaUI.Helpers.Extensions;
-using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.Helpers;
+using PixiEditor.Helpers.Extensions;
 using PixiEditor.Numerics;
 
 namespace PixiEditor.Tests;

+ 14 - 14
tests/PixiEditorTests.sln

@@ -5,8 +5,6 @@ VisualStudioVersion = 17.0.31903.59
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.Tests", "PixiEditor.Tests\PixiEditor.Tests.csproj", "{0EF3CAB9-7361-472C-8789-D17D4EA2DEBB}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.AvaloniaUI.Desktop", "..\src\PixiEditor.AvaloniaUI.Desktop\PixiEditor.AvaloniaUI.Desktop.csproj", "{7F2DBBFC-FBDB-4772-806F-3B0829032DC0}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "References", "References", "{E118E6FE-67E7-4472-A8D7-E7F470E66131}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D914C08C-5F1A-4E13-AAA6-F25E8C9748E2}"
@@ -55,10 +53,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.Backend.Tests",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.ChangeableDocument", "..\src\PixiEditor.ChangeableDocument\PixiEditor.ChangeableDocument.csproj", "{26B5BF58-A3B7-4966-A34C-9E7AF2994165}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.AvaloniaUI", "..\src\PixiEditor.AvaloniaUI\PixiEditor.AvaloniaUI.csproj", "{CEC1685D-7318-4563-B507-3340D43BFBB1}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.Extensions.Gen", "..\src\PixiEditor.Extensions.Gen\PixiEditor.Extensions.Gen.csproj", "{63A2C494-E9D9-486E-B709-39A10DD8B415}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor", "..\src\PixiEditor\PixiEditor.csproj", "{CA5EBC0F-52F8-4359-B7F5-8B33B563D279}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixiEditor.Desktop", "..\src\PixiEditor.Desktop\PixiEditor.Desktop.csproj", "{E9C139E7-8078-477F-8BC3-C7A6BB5445CD}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -72,10 +72,6 @@ Global
 		{0EF3CAB9-7361-472C-8789-D17D4EA2DEBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0EF3CAB9-7361-472C-8789-D17D4EA2DEBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0EF3CAB9-7361-472C-8789-D17D4EA2DEBB}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7F2DBBFC-FBDB-4772-806F-3B0829032DC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7F2DBBFC-FBDB-4772-806F-3B0829032DC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7F2DBBFC-FBDB-4772-806F-3B0829032DC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7F2DBBFC-FBDB-4772-806F-3B0829032DC0}.Release|Any CPU.Build.0 = Release|Any CPU
 		{9C7FFCAD-DDC1-4B69-9B39-30FD4A566CCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{9C7FFCAD-DDC1-4B69-9B39-30FD4A566CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{9C7FFCAD-DDC1-4B69-9B39-30FD4A566CCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -140,17 +136,20 @@ Global
 		{26B5BF58-A3B7-4966-A34C-9E7AF2994165}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{26B5BF58-A3B7-4966-A34C-9E7AF2994165}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{26B5BF58-A3B7-4966-A34C-9E7AF2994165}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CEC1685D-7318-4563-B507-3340D43BFBB1}.Debug|Any CPU.ActiveCfg = Debug|x64
-		{CEC1685D-7318-4563-B507-3340D43BFBB1}.Debug|Any CPU.Build.0 = Debug|x64
-		{CEC1685D-7318-4563-B507-3340D43BFBB1}.Release|Any CPU.ActiveCfg = Release|x64
-		{CEC1685D-7318-4563-B507-3340D43BFBB1}.Release|Any CPU.Build.0 = Release|x64
 		{63A2C494-E9D9-486E-B709-39A10DD8B415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{63A2C494-E9D9-486E-B709-39A10DD8B415}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{63A2C494-E9D9-486E-B709-39A10DD8B415}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{63A2C494-E9D9-486E-B709-39A10DD8B415}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CA5EBC0F-52F8-4359-B7F5-8B33B563D279}.Debug|Any CPU.ActiveCfg = Debug|x64
+		{CA5EBC0F-52F8-4359-B7F5-8B33B563D279}.Debug|Any CPU.Build.0 = Debug|x64
+		{CA5EBC0F-52F8-4359-B7F5-8B33B563D279}.Release|Any CPU.ActiveCfg = Release|x64
+		{CA5EBC0F-52F8-4359-B7F5-8B33B563D279}.Release|Any CPU.Build.0 = Release|x64
+		{E9C139E7-8078-477F-8BC3-C7A6BB5445CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E9C139E7-8078-477F-8BC3-C7A6BB5445CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E9C139E7-8078-477F-8BC3-C7A6BB5445CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E9C139E7-8078-477F-8BC3-C7A6BB5445CD}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
-		{7F2DBBFC-FBDB-4772-806F-3B0829032DC0} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{0EF3CAB9-7361-472C-8789-D17D4EA2DEBB} = {D914C08C-5F1A-4E13-AAA6-F25E8C9748E2}
 		{3C73AAB4-FA0C-475F-AAFE-DB682CB57027} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{9C7FFCAD-DDC1-4B69-9B39-30FD4A566CCB} = {AEB5E9CA-91FB-45DA-A9BF-7E286710C8EF}
@@ -168,12 +167,13 @@ Global
 		{744D7ACF-9C09-4A29-A950-910934D90BFD} = {D914C08C-5F1A-4E13-AAA6-F25E8C9748E2}
 		{26B5BF58-A3B7-4966-A34C-9E7AF2994165} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{6D965165-3B4D-4C70-A559-6AD093879D5A} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
-		{CEC1685D-7318-4563-B507-3340D43BFBB1} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{63A2C494-E9D9-486E-B709-39A10DD8B415} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{69DD5830-C682-49FB-B1A5-D2A506EEA06B} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{1249EE2B-EB0D-411C-B311-53A7A22B7743} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{2BDEB8C6-F22D-43EA-A309-B3387A803689} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{8EF48E6C-8219-4EE2-87C6-5176D8D092E6} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 		{9BCD0764-9C16-4A2A-B153-C676FEF38887} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
+		{CA5EBC0F-52F8-4359-B7F5-8B33B563D279} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
+		{E9C139E7-8078-477F-8BC3-C7A6BB5445CD} = {E118E6FE-67E7-4472-A8D7-E7F470E66131}
 	EndGlobalSection
 EndGlobal