public void TestStepScopeProperty1() { IUnityContainer container = new UnityContainer(); container.AddNewExtension<StepScopeExtension>(); container.RegisterSingleton<A>("a", new InjectionConstructor(), new InjectionProperty("I", new ResolvedParameter<B>("i"))); container.RegisterStepScope<B>("i"); Check(container); }
public void TestAllInStepScope() { IUnityContainer container = new UnityContainer(); container.AddNewExtension<StepScopeExtension>(); container.RegisterStepScope<A>("a", new InjectionConstructor(new ResolvedParameter<B>("i"))); container.RegisterStepScope<B>("i"); StepSynchronizationManager.Register(_stepExecution); var a = container.Resolve<A>("a"); Assert.IsNotNull(a.I); Assert.IsFalse(a.I is IProxyObject); }
public void TestStepScopeUnchanged() { IUnityContainer container = new UnityContainer(); container.AddNewExtension<StepScopeExtension>(); container.RegisterSingleton<A>("a", new InjectionConstructor(new ResolvedParameter<B>("i"))); container.RegisterStepScope<B>("i"); container.RegisterType<I, B>("i"); var a = container.Resolve<A>("a"); Assert.IsNotNull(a.I); Assert.IsTrue(a.I is IProxyObject); }
public void TestStepScopeMethod3() { IUnityContainer container = new UnityContainer(); container.AddNewExtension<StepScopeExtension>(); container.RegisterSingleton<A>("a", new InjectionConstructor(), new InjectionMethod("SetI", new ResolvedParameter<B>())); container.RegisterStepScope<B>(); Check(container); }