Example #1
0
        public FinalIncommingMessageStepTest()
        {
            Trace.Listeners.Add(InMemoryTraceListener.Instance);

            this.finalActionForCommand             = A.Fake <Func <ICommand, Task> >();
            this.finalActionForEvent               = A.Fake <Func <IEvent, Task> >();
            this.finalActionForSubscriptionMessage = A.Fake <Func <SubscriptionMessage, Task> >();

            this.testee = new FinalIncommingMessageStep(
                this.finalActionForCommand,
                this.finalActionForEvent,
                this.finalActionForSubscriptionMessage);
        }
Example #2
0
        /// <summary>
        /// Appends the <see cref="FinalIncommingMessageStep"/> to the list of all registered incomming message pipeline steps
        /// </summary>
        /// <param name="steps">The list of all registered incomming message pipeline steps</param>
        /// <param name="handleCommandAsync">The async command handler action</param>
        /// <param name="handleEventAsync">The async event handler action</param>
        /// <param name="handleSubscriptionMessageAsync">The async subscription message handler action</param>
        /// <returns>The list of all registered incomming message pipeline steps</returns>
        public static IEnumerable <IncommingMessageStep> WithFinalIncommingMessageStep(
            this IEnumerable <IncommingMessageStep> steps,
            Func <ICommand, Task> handleCommandAsync,
            Func <IEvent, Task> handleEventAsync,
            Func <SubscriptionMessage, Task> handleSubscriptionMessageAsync)
        {
            var finalStep = new FinalIncommingMessageStep(
                handleCommandAsync,
                handleEventAsync,
                handleSubscriptionMessageAsync);

            return(steps.Concat(new[] { finalStep }));
        }