Exemple #1
0
        public void Adding_Already_Parented_Control_Should_Throw()
        {
            var root1 = new TestRoot();
            var root2 = new TestRoot();
            var child = new TestVisual();

            root1.AddChild(child);

            Assert.Throws <InvalidOperationException>(() => root2.AddChild(child));
            Assert.Equal(0, root2.GetVisualChildren().Count());
        }
Exemple #2
0
        public void Adding_Already_Parented_Control_Should_Throw()
        {
            var root1 = new TestRoot();
            var root2 = new TestRoot();
            var child = new TestVisual();

            root1.AddChild(child);

            Assert.Throws<InvalidOperationException>(() => root2.AddChild(child));
            Assert.Equal(0, root2.GetVisualChildren().Count());
        }