コード例 #1
0
        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);
        }
コード例 #2
0
 public ViewFrameTest()
 {
     sut = new ViewFrame();
     creator.Setup(i => i.Get(typeof(IViewMappingConvention))).Returns(new ViewMappingConvention());
     DiIntegration.SetContainer(sut, creator.Object);
 }