Exemple #1
0
        public void Describe_T()
        {
            var act = EventHandlerDescriptor.Describe <EmptyEventHandler>(EventHandlerActivationType.Singleton);

            act.ActivationType.ShouldBe(EventHandlerActivationType.Singleton);
            act.HandlerType.ShouldBe(typeof(EmptyEventHandler));
        }
Exemple #2
0
        public void Describe()
        {
            Should.Throw <ArgumentException>(() => EventHandlerDescriptor.Describe(typeof(object), EventHandlerActivationType.Singleton));
            var act = EventHandlerDescriptor.Describe(typeof(EmptyEventHandler), EventHandlerActivationType.Singleton);

            act.ActivationType.ShouldBe(EventHandlerActivationType.Singleton);
            act.HandlerType.ShouldBe(typeof(EmptyEventHandler));
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <param name="activationType"></param>
 /// <typeparam name="TEventHandler"></typeparam>
 /// <returns></returns>
 public static EventBusOptions AddHandler <TEventHandler>(this EventBusOptions options, EventHandlerActivationType activationType)
     where TEventHandler : class, IEventHandler
 {
     options.AddHandler(EventHandlerDescriptor.Describe <TEventHandler>(activationType));
     return(options);
 }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <param name="handlerType"></param>
 /// <param name="activationType"></param>
 /// <returns></returns>
 public static EventBusOptions AddHandler(this EventBusOptions options, Type handlerType, EventHandlerActivationType activationType)
 {
     options.AddHandler(EventHandlerDescriptor.Describe(handlerType, activationType));
     return(options);
 }