public void FindViewModel() { var data = new AViewModel(); var sut = new ViewFrame(); var creator = new Mock <IDIIntegration>(); creator.Setup(i => i.Get(typeof(AView))).Returns(new AView()); DiIntegration.SetContainer(sut, creator.Object); sut.Content = data; Assert.Equal(data, sut.Content); Assert.IsType <AView>(sut.Child); Assert.Equal(data, (sut.Child as FrameworkElement)?.DataContext); }
public ViewFrameTest() { sut = new ViewFrame(); creator.Setup(i => i.Get(typeof(IViewMappingConvention))).Returns(new ViewMappingConvention()); DiIntegration.SetContainer(sut, creator.Object); }