public void TestInitialize() { customizer = new Customizer(); Customizer.SetLocator(new SingleCustomizerLocator(customizer)); Customizer.SetResolver(new DefaultTypeResolver()); Initialize(); }
protected override void Initialize() { Customizer.SetResolver(new TypeResolver(Container)); Context.Strategies.AddNew <CreationStrategy>(UnityBuildStage.PreCreation); Context.Strategies.AddNew <InitializationStrategy>(UnityBuildStage.Initialization); Context.Registering += Context_Registering; }
public static IContainer Setup(IContainer container) { Customizer.SetResolver(new TypeResolver(container)); foreach (var item in container.ComponentRegistry.Registrations.OfType <ComponentRegistration>()) { if (!(item.Activator is InstanceActivator) && item.Activator.LimitType.IsClass && !item.Activator.LimitType.IsAbstract) { item.Activator = new InstanceActivator(item.Activator); } } return(container); }