public void RunShouldInitializeContainer() { var bootstrapper = new DefaultUnityBootstrapper(); var container = bootstrapper.BaseContainer; Assert.IsNull(container); bootstrapper.Run(); container = bootstrapper.BaseContainer; Assert.IsNotNull(container); Assert.IsInstanceOfType(container, typeof(UnityContainer)); }
public void RunShouldCallTheMethodsInOrder() { var bootstrapper = new DefaultUnityBootstrapper(); bootstrapper.Run(); Assert.IsTrue(bootstrapper.MethodCalls[0].Contains("CreateLogger")); Assert.IsTrue(bootstrapper.MethodCalls[1].Contains("CreateModuleCatalog")); Assert.IsTrue(bootstrapper.MethodCalls[2].Contains("ConfigureModuleCatalog")); Assert.IsTrue(bootstrapper.MethodCalls[3].Contains("CreateContainer")); Assert.IsTrue(bootstrapper.MethodCalls[4].Contains("ConfigureContainer")); Assert.IsTrue(bootstrapper.MethodCalls[5].Contains("ConfigureServiceLocator")); Assert.IsTrue(bootstrapper.MethodCalls[6].Contains("ConfigureViewModelLocator")); Assert.IsTrue(bootstrapper.MethodCalls[7].Contains("ConfigureRegionAdapterMappings")); Assert.IsTrue(bootstrapper.MethodCalls[8].Contains("ConfigureDefaultRegionBehaviors")); Assert.IsTrue(bootstrapper.MethodCalls[9].Contains("RegisterFrameworkExceptionTypes")); Assert.IsTrue(bootstrapper.MethodCalls[10].Contains("CreateShell")); Assert.IsTrue(bootstrapper.MethodCalls[11].Contains("InitializeShell")); Assert.IsTrue(bootstrapper.MethodCalls[12].Contains("InitializeModules")); }
public void CanRunBootstrapper() { var bootstrapper = new DefaultUnityBootstrapper(); bootstrapper.Run(); }