internal static void SetExpectation(MessageHandledExpectation expectation) { lock (SyncRoot) { Expectations.Add(expectation); } }
internal static void RemoveExpectation(MessageHandledExpectation expectation) { lock (SyncRoot) { Expectations.Remove(expectation); } }
protected async Task GivenSubscriberExpectsPublication() { SubscriberHandlesPublication = new MessageHandledExpectation <TestPublication>((content, ctx) => Publication.Equals(content) && ctx.Bus == Subscriber); TestPublicationHandler.SetExpectation(SubscriberHandlesPublication); // Wait briefly to ensure subscriptions propagate await Task.Delay(TimeSpan.FromMilliseconds(250)); }