Browse Source

Fixed tests

Krzysztof Krysiński 3 months ago
parent
commit
dbd5bfe33e

+ 5 - 4
tests/PixiEditor.Extensions.Tests/LayoutBuilderElementsTests.cs

@@ -1,5 +1,6 @@
 using Avalonia.Controls;
 using PixiEditor.Extensions.FlyUI.Elements;
+using PixiEditor.Extensions.UI.Panels;
 
 namespace PixiEditor.Extensions.Test;
 
@@ -20,8 +21,8 @@ public class LayoutBuilderElementsTests
         Panel grid = (Panel)result;
         Assert.Single(grid.Children);
 
-        Assert.IsType<StackPanel>(grid.Children[0]);
-        Panel childGrid = (StackPanel)grid.Children[0];
+        Assert.IsType<RowPanel>(grid.Children[0]);
+        Panel childGrid = (RowPanel)grid.Children[0];
 
         Assert.Equal(Avalonia.Layout.HorizontalAlignment.Stretch, childGrid.HorizontalAlignment);
         Assert.Equal(Avalonia.Layout.VerticalAlignment.Stretch, childGrid.VerticalAlignment);
@@ -53,8 +54,8 @@ public class LayoutBuilderElementsTests
         Panel grid = (Panel)result;
         Assert.Single(grid.Children);
 
-        Assert.IsType<StackPanel>(grid.Children[0]);
-        Panel childGrid = (StackPanel)grid.Children[0];
+        Assert.IsType<ColumnPanel>(grid.Children[0]);
+        Panel childGrid = (ColumnPanel)grid.Children[0];
 
         Assert.Equal(Avalonia.Layout.HorizontalAlignment.Stretch, childGrid.HorizontalAlignment);
         Assert.Equal(Avalonia.Layout.VerticalAlignment.Stretch, childGrid.VerticalAlignment);

+ 6 - 5
tests/PixiEditor.Extensions.Tests/LayoutBuilderTests.cs

@@ -2,6 +2,7 @@ using Avalonia.Controls;
 using Avalonia.Controls.Presenters;
 using Avalonia.Interactivity;
 using PixiEditor.Extensions.CommonApi.FlyUI.Events;
+using PixiEditor.Extensions.UI.Panels;
 using Button = PixiEditor.Extensions.FlyUI.Elements.Button;
 
 namespace PixiEditor.Extensions.Test;
@@ -154,19 +155,19 @@ public class LayoutBuilderTests
         var native = testStatefulElement.BuildNative();
 
         Assert.IsType<ContentPresenter>(native);
-        Assert.IsType<StackPanel>((native as ContentPresenter).Content);
-        StackPanel panel = (native as ContentPresenter).Content as StackPanel;
+        Assert.IsType<ColumnPanel>((native as ContentPresenter).Content);
+        ColumnPanel panel = (native as ContentPresenter).Content as ColumnPanel;
 
         Assert.Equal(2, panel.Children.Count);
 
         Assert.IsType<Avalonia.Controls.Button>(panel.Children[0]);
-        Assert.IsType<StackPanel>(panel.Children[1]);
+        Assert.IsType<RowPanel>(panel.Children[1]);
 
-        Assert.Empty((panel.Children[1] as StackPanel).Children);
+        Assert.Empty((panel.Children[1] as RowPanel).Children);
         Assert.Empty(testStatefulElement.State.Rows);
 
         Avalonia.Controls.Button button = (Avalonia.Controls.Button)panel.Children[0];
-        StackPanel innerPanel = (StackPanel)panel.Children[1];
+        RowPanel innerPanel = (RowPanel)panel.Children[1];
 
         button.RaiseEvent(new RoutedEventArgs(Avalonia.Controls.Button.ClickEvent));