public void CreateModuleCatalogShouldInitializeModuleCatalog() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CallCreateModuleCatalog(); Assert.IsNotNull(bootstrapper.BaseModuleCatalog); }
public void OnInitializedShouldRunLast() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.ExtraInitialization); }
public void RegisterFrameworkExceptionTypesShouldRegisterActivationException() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CallRegisterFrameworkExceptionTypes(); Assert.True(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(ActivationException))); }
public void CreateLoggerInitializesLogger() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CallCreateLogger(); Assert.IsNotNull(bootstrapper.BaseLogger); Assert.IsInstanceOfType(bootstrapper.BaseLogger, typeof(TextLogger)); }
public void RegisterFrameworkExceptionTypesShouldRegisterActivationException() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CallRegisterFrameworkExceptionTypes(); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.ServiceLocation.ActivationException))); }
public void ConfigureDefaultRegionBehaviorsShouldAddSevenDefaultBehaviors() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.AreEqual(7, bootstrapper.DefaultRegionBehaviorTypes.Count()); }
public void ConfigureDefaultRegionBehaviorsShouldAddRegionManagerRegistrationBehavior() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey)); }
public void ConfigureDefaultRegionBehaviorsShouldAddAutoPopulateRegionBehavior() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.True(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey)); }
public void ConfigureDefaultRegionBehaviorsShouldBindRegionContextToDependencyObjectBehavior() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToDependencyObjectBehavior.BehaviorKey)); }
public void ConfigureDefaultRegionBehaviorsShouldAddSyncRegionContextWithHostBehavior() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey)); }
public void ConfigureDefaultRegionBehaviorsShouldAddRegionLifetimeBehavior() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithDefaultRegionBehaviors(); bootstrapper.CallConfigureDefaultRegionBehaviors(); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionMemberLifetimeBehavior.BehaviorKey)); }
public void CreateLoggerInitializesLogger() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CallCreateLogger(); Assert.NotNull(bootstrapper.BaseLogger); Assert.IsType <TextLogger>(bootstrapper.BaseLogger); }
public void ConfigureRegionAdapterMappingsShouldRegisterSelectorMapping() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorWithRegionAdapters(); var regionAdapterMappings = bootstrapper.CallConfigureRegionAdapterMappings(); Assert.IsNotNull(regionAdapterMappings); Assert.IsNotNull(regionAdapterMappings.GetMapping(typeof(Selector))); }
public void ConfigureViewModelLocatorShouldUserServiceLocatorAsResolver() { var bootstrapper = new DefaultBootstrapper(); CreateAndConfigureServiceLocatorForViewModelLocator(); bootstrapper.CallConfigureViewModelLocator(); var view = new MockView(); ViewModelLocationProvider.AutoWireViewModelChanged(view, (v, vm) => { Assert.IsNotNull(v); Assert.IsNotNull(vm); Assert.IsInstanceOfType(vm, typeof(MockViewModel)); }); }
public void ShellDefaultsToNull() { var bootstrapper = new DefaultBootstrapper(); Assert.IsNull(bootstrapper.BaseShell); }
public void ModuleCatalogDefaultsToNull() { var bootstrapper = new DefaultBootstrapper(); Assert.IsNull(bootstrapper.BaseModuleCatalog); }
public void LoggerDefaultsToNull() { var bootstrapper = new DefaultBootstrapper(); Assert.IsNull(bootstrapper.BaseLogger); }