public void Should_stop_subscription_when_stopped() { sut.ActivateAsync(consumerName, store).Wait(); sut.Activate(eventConsumer); sut.Stop(); sut.Stop(); sut.Dispose(); state.ShouldBeEquivalentTo(new EventConsumerState { IsStopped = true, Position = initialPosition, Error = null }); A.CallTo(() => persistence.WriteSnapshotAsync(A <EventConsumerState> .Ignored)) .MustHaveHappened(Repeated.Exactly.Once); A.CallTo(() => eventSubscription.StopAsync()) .MustHaveHappened(Repeated.Exactly.Once); }
public void Should_stop_correct_actor() { sut.Run(); pubSub.Publish(new StopConsumerMessage { ConsumerName = consumerName1 }, true); A.CallTo(() => actor1.Stop()) .MustHaveHappened(); A.CallTo(() => actor2.Stop()) .MustNotHaveHappened(); }