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()); } }
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()); } }
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()); } }
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()); } }