Ejemplo n.º 1
0
        public void Adding_Top_Level_As_Child_Should_Throw_Exception()
        {
            using (UnitTestApplication.Start(TestServices.StyledWindow))
            {
                var impl = new Mock <ITopLevelImpl>();
                impl.SetupAllProperties();
                var target = new TestTopLevel(impl.Object);
                var child  = new TestTopLevel(impl.Object);

                target.Template = CreateTemplate();
                target.Content  = child;

                Assert.Throws <InvalidOperationException>(() => target.ApplyTemplate());
            }
        }
Ejemplo n.º 2
0
        public void Adding_Top_Level_As_Child_Should_Throw_Exception()
        {
            using (PerspexLocator.EnterScope())
            {
                RegisterServices();

                var impl = new Mock <ITopLevelImpl>();
                impl.SetupAllProperties();
                var target = new TestTopLevel(impl.Object);
                var child  = new TestTopLevel(impl.Object);

                target.Template = CreateTemplate();
                target.Content  = child;

                Assert.Throws <InvalidOperationException>(() => target.ApplyTemplate());
            }
        }
Ejemplo n.º 3
0
        public void Adding_Top_Level_As_Child_Should_Throw_Exception()
        {
            using (PerspexLocator.EnterScope())
            {
                RegisterServices();

                var impl = new Mock<ITopLevelImpl>();
                impl.SetupAllProperties();
                var target = new TestTopLevel(impl.Object);
                var child = new TestTopLevel(impl.Object);

                target.Template = CreateTemplate();
                target.Content = child;

                Assert.Throws<InvalidOperationException>(() => target.ApplyTemplate());
            }
        }
Ejemplo n.º 4
0
        public void Adding_Top_Level_As_Child_Should_Throw_Exception()
        {
            using (UnitTestApplication.Start(TestServices.StyledWindow))
            {
                var impl = new Mock<ITopLevelImpl>();
                impl.SetupAllProperties();
                var target = new TestTopLevel(impl.Object);
                var child = new TestTopLevel(impl.Object);

                target.Template = CreateTemplate();
                target.Content = child;

                Assert.Throws<InvalidOperationException>(() => target.ApplyTemplate());
            }
        }