Exemplo n.º 1
0
        public void Added_Child_Should_Have_VisualParent_Set()
        {
            var target = new TestVisual();
            var child  = new Visual();

            target.AddChild(child);

            Assert.Equal(target, child.GetVisualParent());
        }
Exemplo n.º 2
0
        public void Added_Child_Should_Have_InheritanceParent_Set()
        {
            var target = new TestVisual();
            var child  = new TestVisual();

            target.AddChild(child);

            Assert.Equal(target, child.InheritanceParent);
        }
Exemplo n.º 3
0
        public void Removed_Child_Should_Have_InheritanceParent_Cleared()
        {
            var target = new TestVisual();
            var child  = new TestVisual();

            target.AddChild(child);
            target.RemoveChild(child);

            Assert.Null(child.InheritanceParent);
        }
Exemplo n.º 4
0
        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());
        }
Exemplo n.º 5
0
        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);
        }