public virtual async Task WriteStateAsync() { if (stateHolder != null) { await stateHolder.WriteAsync(); } }
public void Should_stop_subscription_when_stopped() { sut.Activate(eventConsumer); sut.Stop(); sut.Stop(); sut.Dispose(); state.ShouldBeEquivalentTo(new EventConsumerState { IsStopped = true, Position = initialPosition, Error = null }); A.CallTo(() => stateHolder.WriteAsync()) .MustHaveHappened(Repeated.Exactly.Once); A.CallTo(() => eventSubscription.StopAsync()) .MustHaveHappened(Repeated.Exactly.Once); }