public void It_should_be_added_to_the_pipeline_for_remote_subscribers() { // okay, this is incredibly hard to mock due to the fact that the pipeline does NOT // perform the actual configuration. The visitor-based configurator is sweet, but mocking // it is just not happening. We'll use a real pipeline instead and verify that it actually // calls the methods instead. _consumer.SubscribedTo <PingMessage>(_remoteUri); var message = new PingMessage(); _pipeline.Dispatch(message); _remoteEndpoint.AssertWasCalled(x => x.Send(message)); }
private static void PublishBatch(IMessagePipeline _pipeline, int _batchSize) { _batchId = Guid.NewGuid(); for (int i = 0; i < _batchSize; i++) { IndividualBatchMessage message = new IndividualBatchMessage(_batchId, _batchSize); _pipeline.Dispatch(message); } }
/// <summary> /// Dispatch a message through the pipeline /// </summary> /// <param name="pipeline">The pipeline instance</param> /// <param name="message">The message to dispatch</param> public static bool Dispatch(this IMessagePipeline pipeline, object message) { return(pipeline.Dispatch(message, x => true)); }