예제 #1
0
        public void ShouldAttachNewRegionByUsingRegisteredRegionAdapterMappings()
        {
            var mappings          = new RegionAdapterMappings();
            var mockRegionAdapter = new MockRegionAdapter();

            mappings.RegisterMapping(typeof(DependencyObject), mockRegionAdapter);
            var regionManager = new RegionManager(mappings);
            var control       = new ContentControl();

            regionManager.AttachNewRegion(control, "TestRegionName");

            Assert.IsTrue(mockRegionAdapter.InitializeCalled);
            Assert.AreEqual(control, mockRegionAdapter.InitializeArgument);
        }
예제 #2
0
        public void ShouldAttachNewRegionByUsingRegisteredRegionAdapterMappings()
        {
            var mappings = new RegionAdapterMappings();
            var mockRegionAdapter = new MockRegionAdapter();
            mappings.RegisterMapping(typeof(DependencyObject), mockRegionAdapter);
            var regionManager = new RegionManager(mappings);
            var control = new ContentControl();

            regionManager.AttachNewRegion(control, "TestRegionName");

            Assert.IsTrue(mockRegionAdapter.InitializeCalled);
            Assert.AreEqual(control, mockRegionAdapter.InitializeArgument);
        }