예제 #1
0
        /// <summary>
        /// Check that the object sends the given message type to the appropriate destination.
        /// </summary>
        /// <typeparam name="TMessage"></typeparam>
        /// <param name="check"></param>
        /// <returns></returns>
        public void ExpectSendToDestination <TMessage>(SendToDestinationPredicate <TMessage> check)
        {
            MessagingBestPractices.AssertIsValidForSend(typeof(TMessage), MessageIntentEnum.Send);

            Delegate d = new HandleMessageDelegate(
                () => ExpectCallToSend <TMessage>(
                    delegate(string destination, object[] msgs)
            {
                foreach (TMessage msg in msgs)
                {
                    if (!check(destination, msg))
                    {
                        return(false);
                    }
                }

                return(true);
            }
                    )
                );

            delegates.Add(d);
        }
예제 #2
0
 /// <summary>
 /// Check that the saga sends the given message type to the appropriate destination.
 /// </summary>
 /// <typeparam name="TMessage"></typeparam>
 /// <param name="check"></param>
 /// <returns></returns>
 public Saga <T> ExpectSendToDestination <TMessage>(SendToDestinationPredicate <TMessage> check)
 {
     helper.ExpectSendToDestination(check);
     return(this);
 }
예제 #3
0
 /// <summary>
 /// Check that the saga sends the given message type to the appropriate destination.
 /// </summary>
 /// <typeparam name="TMessage"></typeparam>
 /// <param name="check"></param>
 /// <returns></returns>
 public Handler <T> ExpectSendToDestination <TMessage>(SendToDestinationPredicate <TMessage> check) where TMessage : IMessage
 {
     helper.ExpectSendToDestination(check);
     return(this);
 }