Browse Source

Added failing test for #10246.

pull/10338/head
Steven Kirk 3 years ago
parent
commit
b92134c682
  1. 19
      tests/Avalonia.Controls.UnitTests/ItemsControlTests.cs

19
tests/Avalonia.Controls.UnitTests/ItemsControlTests.cs

@ -147,6 +147,25 @@ namespace Avalonia.Controls.UnitTests
Assert.Equal(new[] { child }, target.GetLogicalChildren());
}
[Fact]
public void Control_Item_Should_Be_Logical_Child_After_Layout()
{
var target = new ItemsControl
{
Template = GetTemplate(),
};
var root = new TestRoot(target);
var child = new Control();
target.Template = GetTemplate();
target.Items = new[] { child };
root.LayoutManager.ExecuteInitialLayoutPass();
Assert.Equal(target, child.Parent);
Assert.Equal(target, child.GetLogicalParent());
Assert.Equal(new[] { child }, target.GetLogicalChildren());
}
[Fact]
public void Added_Container_Should_Have_LogicalParent_Set_To_ItemsControl()
{

Loading…
Cancel
Save