public void ShouldCallInitializeModules() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.InitializeModulesCalled); }
public void ShouldNotFailIfReturnedNullShell() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.CreateShellReturnValue = null; bootstrapper.Run(); }
public void NotOvewrittenGetModuleEnumeratorThrowsOnDefaultModuleInitialization() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.OverrideGetModuleEnumerator = false; AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), "IModuleEnumerator"); }
public void NullModuleEnumeratorThrowsOnDefaultModuleInitialization() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.ModuleEnumerator = null; AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), "IModuleEnumerator"); }
public void NullLoggerThrows() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.ReturnNullDefaultLogger = true; AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), "ILoggerFacade"); }
public void ShouldCallConfigureRegionAdapterMappings() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.ConfigureRegionAdapterMappingsCalled); }
public void ShouldCallConfigureTypeMappings() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.ConfigureContainerCalled); }
public void ShouldCallCreateSell() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.CreateShellCalled); }
public void ShouldCallGetCatalog() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.GetModuleCatalogCalled); }
public void ShouldCallGetLogger() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.GetLoggerCalled); }
public void GetLoggerShouldHaveDefault() { var bootstrapper = new DefaultBootstrapper(); Assert.IsNull(bootstrapper.DefaultLogger); bootstrapper.Run(); Assert.IsNotNull(bootstrapper.DefaultLogger); Assert.IsInstanceOfType(bootstrapper.DefaultLogger, typeof(TraceLogger)); }
public void ShouldRegisterDefaultMappings() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsNotNull(bootstrapper.DefaultRegionAdapterMappings); Assert.IsNotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ItemsControl))); Assert.IsNotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(ContentControl))); // Assert.IsNotNull(bootstrapper.DefaultRegionAdapterMappings.GetMapping(typeof(Selector))); }
public void ShouldAssignRegionManagerToReturnedShell() { var bootstrapper = new DefaultBootstrapper(); var shell = new UserControl(); bootstrapper.CreateShellReturnValue = shell; Assert.IsNull(RegionManager.GetRegionManager(shell)); bootstrapper.Run(); Assert.IsNotNull(RegionManager.GetRegionManager(shell)); }
public void ShouldInitializeContainer() { var bootstrapper = new DefaultBootstrapper(); var container = bootstrapper.GetBaseContainer(); Assert.IsNull(container); bootstrapper.Run(); container = bootstrapper.GetBaseContainer(); Assert.IsNotNull(container); Assert.IsInstanceOfType(container, typeof(UnityContainer)); }
public void ShouldRegisterFrameworkExceptionTypes() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.ServiceLocation.ActivationException))); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.Unity.ResolutionFailedException))); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.ObjectBuilder2.BuildFailedException))); }
public void ShouldRegisterDefaultRegionBehaviorTypes() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(AutoPopulateRegionBehavior.BehaviorKey)); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(BindRegionContextToDependencyObjectBehavior.BehaviorKey)); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionActiveAwareBehavior.BehaviorKey)); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(SyncRegionContextWithHostBehavior.BehaviorKey)); Assert.IsTrue(bootstrapper.DefaultRegionBehaviorTypes.ContainsKey(RegionManagerRegistrationBehavior.BehaviorKey)); Assert.AreEqual(5, bootstrapper.DefaultRegionBehaviorTypes.Count()); }
public void CanRunBootstrapper() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); }
public void ShouldAssignRegionManagerToReturnedShell() { var bootstrapper = new DefaultBootstrapper(); //var shell = new DependencyObject(); var shell = new UserControl(); bootstrapper.CreateShellReturnValue = shell; Assert.IsNull(RegionManager.GetRegionManager(shell)); bootstrapper.Run(); Assert.IsNotNull(RegionManager.GetRegionManager(shell)); }
public void ShouldRegisterFrameworkExceptionTypes() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof (Microsoft.Practices.ServiceLocation.ActivationException))); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.Unity.ResolutionFailedException))); Assert.IsTrue(ExceptionExtensions.IsFrameworkExceptionRegistered( typeof(Microsoft.Practices.ObjectBuilder2.BuildFailedException))); }
public void ShouldCallGetEnumerator() { var bootstrapper = new DefaultBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.GetEnumeratorCalled); }