public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator, PageTypeBuilderConfiguration configuration, PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine, PageTypeDefinitionValidator pageTypeDefinitionValidator, PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator, PageTypeUpdater pageTypeUpdater, TabDefinitionUpdater tabDefinitionUpdater, TabLocator tabLocator, GlobalPropertySettingsSynchronizer globalPropertySettingsSynchronizer, IHooksHandler hooksHandler) { _configuration = configuration; this.pageTypeResolver = pageTypeResolver; TabLocator = tabLocator; TabDefinitionUpdater = tabDefinitionUpdater; using (new TimingsLogger("Getting page type definitions")) { _pageTypeDefinitions = pageTypeDefinitionLocator.GetPageTypeDefinitions(); } PageTypeUpdater = pageTypeUpdater; PageDefinitionSynchronizationEngine = pageDefinitionSynchronizationEngine; PageTypeDefinitionValidator = pageTypeDefinitionValidator; _pageTypeLocator = pageTypeLocator; this.globalPropertySettingsSynchronizer = globalPropertySettingsSynchronizer; this.hooksHandler = hooksHandler; }
public void GivenNonAbstractDescendantOfTabInApplicationDomain_GetDefinedTabs_ReturnsListOfTabsWithInstanceOfThatClass() { Type typeThatShouldBeLocated = typeof(TestTab); TabLocator tabLocator = TabLocatorFactory.Create(); IEnumerable <Tab> definedTabs = tabLocator.GetDefinedTabs(); Assert.Equal <int>(1, definedTabs.Count(tab => tab.GetType() == typeThatShouldBeLocated)); }
public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator, PageTypeBuilderConfiguration configuration, PageTypePropertyUpdater pageTypePropertyUpdater, PageTypeDefinitionValidator pageTypeDefinitionValidator, PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator, PageTypeUpdater pageTypeUpdater, TabDefinitionUpdater tabDefinitionUpdater, TabLocator tabLocator) { _configuration = configuration; PageTypeResolver = pageTypeResolver; TabLocator = tabLocator; TabDefinitionUpdater = tabDefinitionUpdater; _pageTypeDefinitions = pageTypeDefinitionLocator.GetPageTypeDefinitions(); PageTypeUpdater = pageTypeUpdater; PageTypePropertyUpdater = pageTypePropertyUpdater; PageTypeDefinitionValidator = pageTypeDefinitionValidator; _pageTypeLocator = pageTypeLocator; }
public void Initialize(InitializationEngine context) { var pageTypeLocator = new PageTypeLocator(new PageTypeFactory()); var pageTypeDefinitionLocator = new PageTypeDefinitionLocator( new AppDomainAssemblyLocator()); var pageTypeUpdater = new PageTypeUpdater( pageTypeDefinitionLocator, new PageTypeFactory(), new PageTypeValueExtractor(), pageTypeLocator); var pageTypePropertyUpdater = new PageTypePropertyUpdater( new PageDefinitionFactory(), new PageDefinitionTypeFactory(), new TabFactory(), new PropertySettingsRepository()); var tabDefinitionUpdater = new TabDefinitionUpdater(new TabFactory()); var tabLocator = new TabLocator(new AppDomainAssemblyLocator()); PageTypeSynchronizer synchronizer = new PageTypeSynchronizer( pageTypeDefinitionLocator, Configuration, pageTypePropertyUpdater, new PageTypeDefinitionValidator(new PageDefinitionTypeMapper(new PageDefinitionTypeFactory())), PageTypeResolver.Instance, pageTypeLocator, pageTypeUpdater, tabDefinitionUpdater, tabLocator); synchronizer.SynchronizePageTypes(); DataFactory.Instance.LoadedPage += DataFactory_LoadedPage; DataFactory.Instance.LoadedChildren += DataFactory_LoadedChildren; DataFactory.Instance.LoadedDefaultPageData += DataFactory_LoadedPage; }
public void UpdateTabDefinitions_CallsTabDefinitionUpdaterWithDefinedTabs() { PageTypeSynchronizer pageTypeSynchronizer = PageTypeSynchronizerFactory.Create(); MockRepository fakes = new MockRepository(); TabLocator fakeTabLocator = TabLocatorFactory.Stub(fakes); List <Tab> tabs = new List <Tab> { new TestTab() }; fakeTabLocator.Stub(locator => locator.GetDefinedTabs()).Return(tabs); fakeTabLocator.Replay(); pageTypeSynchronizer.TabLocator = fakeTabLocator; TabDefinitionUpdater fakeTabDefinitionUpdater = TabDefinitionUpdaterFactory.Stub(fakes); fakeTabDefinitionUpdater.Stub(updater => updater.UpdateTabDefinitions(Arg <List <Tab> > .Is.Anything)); fakeTabDefinitionUpdater.Replay(); pageTypeSynchronizer.TabDefinitionUpdater = fakeTabDefinitionUpdater; pageTypeSynchronizer.UpdateTabDefinitions(); pageTypeSynchronizer.TabLocator.AssertWasCalled(updater => updater.GetDefinedTabs()); pageTypeSynchronizer.TabDefinitionUpdater.AssertWasCalled(updater => updater.UpdateTabDefinitions(tabs)); }
public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator, PageTypeBuilderConfiguration configuration, PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine, PageTypeDefinitionValidator pageTypeDefinitionValidator, PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator, PageTypeUpdater pageTypeUpdater, TabDefinitionUpdater tabDefinitionUpdater, TabLocator tabLocator, GlobalPropertySettingsSynchronizer globalPropertySettingsSynchronizer, IHooksHandler hooksHandler) { _configuration = configuration; this.pageTypeResolver = pageTypeResolver; TabLocator = tabLocator; TabDefinitionUpdater = tabDefinitionUpdater; _pageTypeDefinitions = pageTypeDefinitionLocator.GetPageTypeDefinitions(); PageTypeUpdater = pageTypeUpdater; PageDefinitionSynchronizationEngine = pageDefinitionSynchronizationEngine; PageTypeDefinitionValidator = pageTypeDefinitionValidator; _pageTypeLocator = pageTypeLocator; this.globalPropertySettingsSynchronizer = globalPropertySettingsSynchronizer; this.hooksHandler = hooksHandler; }
protected internal virtual void UpdateTabDefinitions() { IEnumerable <Tab> definedTabs = TabLocator.GetDefinedTabs(); TabDefinitionUpdater.UpdateTabDefinitions(definedTabs); }