public override void PreBuildUp(IBuilderContext context) { var policy = context.Policies.Get<InterceptorPolicy>(context.BuildKey); if (policy != null) { ICollection<IDynamicInterceptor> interceptors = policy.RetrieveInterceptors(context); var dynamicInterceptorManager = new DynamicInterceptorManager(new DynamicInterceptorCollection(interceptors)); context.AddResolverOverrides(new DependencyOverride<IDynamicInterceptorManager>(dynamicInterceptorManager)); } }
public override void PreBuildUp(IBuilderContext context) { var policy = context.Policies.Get <InterceptorPolicy>(context.BuildKey); if (policy != null) { ICollection <IDynamicInterceptor> interceptors = policy.RetrieveInterceptors(context); var dynamicInterceptorManager = new DynamicInterceptorManager(new DynamicInterceptorCollection(interceptors)); context.AddResolverOverrides(new DependencyOverride <IDynamicInterceptorManager>(dynamicInterceptorManager)); } }
public DynamicInterceptorManagerTest() { this.interceptorCollection = new FakeDynamicInterceptorCollection(); this.targetInvocationFactory = new Mock<ITargetInvocationFactory> { DefaultValue = DefaultValue.Mock }; this.invocationFactory = new Mock<IInvocationFactory> { DefaultValue = DefaultValue.Mock }; this.typeInformation = new Mock<ITypeInformation>(); this.testee = new DynamicInterceptorManager( this.interceptorCollection, this.targetInvocationFactory.Object, this.invocationFactory.Object, this.typeInformation.Object); }
public DynamicInterceptorManagerTest() { this.interceptorCollection = new FakeDynamicInterceptorCollection(); this.targetInvocationFactory = new Mock <ITargetInvocationFactory> { DefaultValue = DefaultValue.Mock }; this.invocationFactory = new Mock <IInvocationFactory> { DefaultValue = DefaultValue.Mock }; this.typeInformation = new Mock <ITypeInformation>(); this.testee = new DynamicInterceptorManager( this.interceptorCollection, this.targetInvocationFactory.Object, this.invocationFactory.Object, this.typeInformation.Object); }