public void Added_Child_Should_Have_VisualParent_Set() { var target = new TestVisual(); var child = new Visual(); target.AddChild(child); Assert.Equal(target, child.GetVisualParent()); }
public void Removed_Child_Should_Have_VisualParent_Cleared() { var target = new TestVisual(); var child = new Visual(); target.AddChild(child); target.RemoveChild(child); Assert.Null(child.GetVisualParent()); }
public void Added_Child_Should_Notify_VisualParent_Changed() { var target = new TestVisual(); var child = new TestVisual(); var parents = new List <IVisual>(); child.GetObservable(Visual.VisualParentProperty).Subscribe(x => parents.Add(x)); target.AddChild(child); target.RemoveChild(child); Assert.Equal(new IVisual[] { null, target, null }, parents); }