public static IHaveFulfilledSubscriptionRequirements WithMessageHandlers <T>( this IFluentSubscription sub, params IHandlerAsync <T>[] handlers) where T : Message { if (handlers.Length == 0) { throw new ArgumentException("No handlers in list"); } if (handlers.Length == 1) { sub.WithMessageHandler(handlers[0]); } var listHandler = new ListHandler <T>(handlers); return(sub.WithMessageHandler(listHandler)); }
public void ConfigurationIsNotRequired() { // Tested by the fact that handlers can be added _bus.WithMessageHandler(_handler) .WithMessageHandler(_handler); }