/// <summary> /// Check that the object publishes a message of the given type complying with the given predicate. /// </summary> /// <typeparam name="TMessage"></typeparam> /// <param name="check"></param> /// <returns></returns> public void ExpectPublish <TMessage>(PublishPredicate <TMessage> check) where TMessage : IMessage { Delegate d = new HandleMessageDelegate( () => ExpectCallToPublish( delegate(TMessage[] msgs) { foreach (TMessage msg in msgs) { if (!check(msg)) { return(false); } } return(true); } ) ); delegates.Add(d); }
/// <summary> /// Check that the object publishes a message of the given type complying with the given predicate. /// </summary> /// <typeparam name="TMessage"></typeparam> /// <param name="check"></param> /// <returns></returns> public void ExpectPublish <TMessage>(PublishPredicate <TMessage> check) { MessagingBestPractices.AssertIsValidForPubSub(typeof(TMessage)); Delegate d = new HandleMessageDelegate( () => ExpectCallToPublish( delegate(TMessage[] msgs) { foreach (TMessage msg in msgs) { if (!check(msg)) { return(false); } } return(true); } ) ); delegates.Add(d); }
/// <summary> /// Check that the saga does not publish any messages of the given type complying with the given predicate. /// </summary> /// <typeparam name="TMessage"></typeparam> /// <param name="check"></param> /// <returns></returns> public Saga <T> ExpectNotPublish <TMessage>(PublishPredicate <TMessage> check) { helper.ExpectNotPublish(check); return(this); }
/// <summary> /// Check that the saga publishes a message of the given type complying with the given predicate. /// </summary> /// <typeparam name="TMessage"></typeparam> /// <param name="check"></param> /// <returns></returns> public Saga <T> ExpectPublish <TMessage>(PublishPredicate <TMessage> check) where TMessage : IMessage { helper.ExpectPublish(check); return(this); }
/// <summary> /// Check that the saga publishes a message of the given type complying with the given predicate. /// </summary> /// <typeparam name="TMessage"></typeparam> /// <param name="check"></param> /// <returns></returns> public Handler <T> ExpectPublish <TMessage>(PublishPredicate <TMessage> check) { helper.ExpectPublish(check); return(this); }