public async Task Command2ShouldBeDispatchedToTheCorrectHandler() { MethodCallCounter.ReceivedCallsWithAnyArg <BrokerTestCommandHandler>(h => h.Handle(null)) .Select(c => c.Single()) .Cast <FooCommand>() .Select(c => c.Id) .ShouldContain(_id2); }
public async Task TheMulticastEventBrokerShouldReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <SomeMulticastEventHandler>(mb => mb.Handle((SomeEventWeOnlyHandleViaMulticast)null)) .Count() .ShouldBe(1); }
public async Task TheCompetingEventBrokerShouldReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <SomeCompetingEventHandler>(mb => mb.Handle((SomeEventWeHandleViaMulticastAndCompetition)null)) .Count() .ShouldBe(1); }
public async Task BothInstancesOfTheCommandHandlerShouldHaveBeenDisposed() { var calls = MethodCallCounter.ReceivedCallsWithAnyArg <BrokerTestCommandHandler>(h => h.Dispose()); calls.Count().ShouldBe(_expectedCallCount); }
public async Task TheBaseClassLevelSuccessInterceptorShouldHaveBeenInvoked() { MethodCallCounter.ReceivedCallsWithAnyArg <SomeBaseClassLevelInterceptor>(i => i.OnCommandHandlerSuccess <FooCommand>(null, null)).Count().ShouldBe(1); }
public async Task ATotalOfTwoCallsToHandleShouldBeReceived() { var calls = MethodCallCounter.ReceivedCallsWithAnyArg <BrokerTestCommandHandler>(h => h.Handle(null)); calls.Count().ShouldBe(_expectedCallCount); }
public async Task TheCommandBrokerShouldReceiveThatCommand() { MethodCallCounter.ReceivedCallsWithAnyArg <MultipleCommandHandler>(h => h.Handle((FooCommand)null)).Count().ShouldBe(1); }
public async Task TheBaseMethodLevelExecutingInterceptorShouldHaveBeenInvoked() { MethodCallCounter.ReceivedCallsWithAnyArg <SomeBaseMethodLevelInterceptorForFoo>(i => i.OnCommandHandlerExecuting <FooCommand>(null, null)).Count().ShouldBe(1); }
public async Task TheMulticastEventBrokerShouldReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <SomeConcreteEventTypeMulticastHandler>(mb => mb.Handle(null)) .Count() .ShouldBe(1); }
public async Task HandlersWithNoFilterShouldReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <HandlerWithNoFilter>(h => h.Handle(_busEvent)) .Count() .ShouldBe(1); }
public async Task TheHandlerWithTheNonMatchingSubscriptionShouldNotReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <HandlerWithNonMatchingFilter>(h => h.Handle(_busEvent)) .Count() .ShouldBe(0); }
public async Task TheHandlerWithTheMatchingExpressionShouldReceiveTheEvent() { MethodCallCounter.ReceivedCallsWithAnyArg <HandlerWithMatchingFilter>(h => h.Handle(_busEvent)) .Count() .ShouldBe(1); }
public async Task TheNonExplodingEventHandlerShouldHaveSeenTheMessageOnce() { var nonExplodingCalls = MethodCallCounter.ReceivedCallsWithAnyArg <DoesNotGoBangCompetingEventHandler>(h => h.Handle(_goBangEvent)).ToArray(); nonExplodingCalls.Length.ShouldBe(1); }