public void ShouldAddNotificationViewToNotificationsRegion()
        {
            var toolsRegion          = new MockRegion();
            var regionManager        = new MockRegionManager();
            var container            = new MockUnityContainer();
            var configurationService = new MockConfigurationService();

            container.Bag.Add(typeof(INotificationViewPresenter), new MockNotificationViewPresenter());
            container.Bag.Add(typeof(IProjectService), new MockProjectService());
            container.Bag.Add(typeof(ICacheManager), new MockCacheManager());
            container.Bag.Add(typeof(IConfigurationService), configurationService);

            toolsRegion.Name = RegionNames.NotificationsRegion;
            regionManager.Regions.Add(toolsRegion);
            configurationService.GetParameterValueReturnFunction = p => "polling";

            var module = new ServicesModule(container, regionManager);

            Assert.AreEqual(0, toolsRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, toolsRegion.AddedViews.Count);
            Assert.IsInstanceOfType(toolsRegion.AddedViews[0], typeof(INotificationView));
        }
示例#2
0
        public void ShouldAddNotificationViewToNotificationsRegion()
        {
            var toolsRegion   = new MockRegion();
            var regionManager = new MockRegionManager();
            var container     = new MockUnityResolver();

            container.Bag.Add(typeof(INotificationViewPresenter), new MockNotificationViewPresenter());
            container.Bag.Add(typeof(IProjectService), new MockProjectService());
            toolsRegion.Name = RegionNames.NotificationsRegion;
            regionManager.Regions.Add(toolsRegion);

            var module = new ServicesModule(container, regionManager);

            Assert.AreEqual(0, toolsRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, toolsRegion.AddedViews.Count);
            Assert.IsInstanceOfType(toolsRegion.AddedViews[0], typeof(INotificationView));
        }