public void CanRegisterDelegate()
        {
            try
            {
                var mockRegionContentRegistry = new MockRegionContentRegistry();

                string       regionName      = null;
                Func <IView> contentDelegate = null;

                Func <IView> expectedDelegate = () => new MockView();
                mockRegionContentRegistry.RegisterContentWithDelegate = (name, usedDelegate) =>
                {
                    regionName      = name;
                    contentDelegate = usedDelegate;
                    return(null);
                };
                ServiceLocator.SetLocatorProvider(
                    () => new MockServiceLocator
                {
                    GetInstance = t => mockRegionContentRegistry
                });

                var regionManager = new MockRegionManager();

                regionManager.RegisterViewWithRegion("Region1", expectedDelegate);

                Assert.AreEqual("Region1", regionName);
                Assert.AreEqual(expectedDelegate, contentDelegate);
            }
            finally
            {
                ServiceLocator.SetLocatorProvider(null);
            }
        }
        public void CanRegisterViewType()
        {
            try
            {
                var mockRegionContentRegistry = new MockRegionContentRegistry();

                string regionName = null;
                Type   viewType   = null;

                mockRegionContentRegistry.RegisterContentWithViewType = (name, type) =>
                {
                    regionName = name;
                    viewType   = type;
                    return(null);
                };
                ServiceLocator.SetLocatorProvider(
                    () => new MockServiceLocator
                {
                    GetInstance = t => mockRegionContentRegistry
                });

                var regionManager = new MockRegionManager();

                regionManager.RegisterViewWithRegion("Region1", typeof(object));

                Assert.AreEqual(regionName, "Region1");
                Assert.AreEqual(viewType, typeof(object));
            }
            finally
            {
                ServiceLocator.SetLocatorProvider(null);
            }
        }