public NotificationPipelineFactoryShould() { _engine = new Mock <IDependencyEngine>(); _factory = new NotificationPipelineFactory(); _pipelineType = typeof(INotificationPipeline <Notification>); _processorType = typeof(INotificationProcessor <Notification>); }
internal static void UpsertPipeline(IServiceCollection services, Type contract, ServiceLifetime lifetime) { var notificationType = contract.GenericTypeArguments[0]; var pipelineType = Types.NotificationPipeline.MakeGenericType(notificationType); if (services.RemoveLessLifetimeService(pipelineType, lifetime, true)) { services.Add(new ServiceDescriptor( pipelineType, NotificationPipelineFactory.GetActivator(notificationType), lifetime)); } }