/// <summary>
        /// Activates the test that has been set up passing in the given message,
        /// setting the incoming headers and the message Id.
        /// </summary>
        public void OnMessage <TMessage>(string messageId, Action <TMessage> initializeMessage = null)
        {
            var msg = bus.CreateInstance(initializeMessage);

            OnMessage(msg, messageId);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the given message type and checks all the expectations previously set up,
        /// and then clears them for continued testing.
        /// </summary>
        public Saga <T> WhenHandling <TMessage>(Action <TMessage> initializeMessage = null)
        {
            var msg = bus.CreateInstance(initializeMessage);

            return(When(_ => ((dynamic)saga).Handle(msg)));
        }