Exemplo n.º 1
0
 public virtual async Task WriteStateAsync()
 {
     if (stateHolder != null)
     {
         await stateHolder.WriteAsync();
     }
 }
Exemplo n.º 2
0
        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);
        }