Browse Source

Tests fixing

pull/8599/head
Evgeny Gorbovoy 4 years ago
parent
commit
c226432e9b
  1. 9
      tests/Avalonia.Base.UnitTests/Rendering/CompositorHitTestingTests.cs
  2. 9
      tests/Avalonia.Base.UnitTests/Rendering/DeferredRendererTests_HitTesting.cs

9
tests/Avalonia.Base.UnitTests/Rendering/CompositorHitTestingTests.cs

@ -414,21 +414,22 @@ public class CompositorHitTestingTests : CompositorTestsBase
{
using (var s = new CompositorServices(new Size(200, 200)))
{
Button targetButton;
Rectangle targetRectangle;
var stackPanel = new StackPanel
{
Orientation = Orientation.Vertical,
HorizontalAlignment = HorizontalAlignment.Left,
Children =
{
new Button { Width = 10, Height = 10 },
{ targetButton = new Button { Width = 10, Height = 10 } }
new Rectangle { Width = 10, Height = 10, Fill= Brushes.Red},
{ targetRectangle = new Rectangle { Width = 10, Height = 10, Fill = Brushes.Green} }
}
};
s.TopLevel.Content = stackPanel;
s.AssertHitTest(new Point(5, 10), null, targetButton);
s.AssertHitTest(new Point(5, 10), null, targetRectangle);
}
}

9
tests/Avalonia.Base.UnitTests/Rendering/DeferredRendererTests_HitTesting.cs

@ -542,7 +542,7 @@ namespace Avalonia.Base.UnitTests.Rendering
{
using (TestApplication())
{
Button targetButton;
Rectangle targetRectangle;
var root = new TestRoot
{
@ -551,10 +551,11 @@ namespace Avalonia.Base.UnitTests.Rendering
Child = new StackPanel
{
Orientation = Orientation.Vertical,
HorizontalAlignment = HorizontalAlignment.Left,
Children =
{
new Button { Width = 10, Height = 10 },
{ targetButton = new Button { Width = 10, Height = 10 } }
new Rectangle { Width = 10, Height = 10, Fill = Brushes.Red},
{ targetRectangle = new Rectangle { Width = 10, Height = 10, Fill = Brushes.Green} }
}
}
};
@ -564,7 +565,7 @@ namespace Avalonia.Base.UnitTests.Rendering
root.Arrange(new Rect(root.DesiredSize));
var result = root.Renderer.HitTest(new Point(5, 10), root, null);
Assert.Equal(new[] { targetButton }, result);
Assert.Equal(new[] { targetRectangle }, result);
}
}

Loading…
Cancel
Save