public SetCountWhenUserCreatedSubscriber(
     IHttpContextAccessor httpContextAccessor,
     PublishUserCreatedDomainEvent singletonValueContainer)
 {
     _httpContextAccessor     = httpContextAccessor;
     _singletonValueContainer = singletonValueContainer;
 }
Exemple #2
0
        public static async Task PublishDomainEvent(IEventBus eventBus, PublishUserCreatedDomainEvent singletonValueContainer, int millisecondsDelay)
        {
            var user = UserMother.Create();

            await eventBus.Publish(user.PullDomainEvents(), CancellationToken.None).ConfigureAwait(false);

            await Task.Delay(millisecondsDelay, CancellationToken.None).ConfigureAwait(false);

            Assert.Equal(user.Id, singletonValueContainer.UserId);
            Assert.True(singletonValueContainer.Total >= 2);
        }
 public SetUserIdWhenUserCreatedSubscriber(
     PublishUserCreatedDomainEvent singletonValueContainer)
 {
     _singletonValueContainer = singletonValueContainer;
 }