コード例 #1
0
 public SetCountWhenUserCreatedSubscriber(
     IHttpContextAccessor httpContextAccessor,
     PublishUserCreatedDomainEvent singletonValueContainer)
 {
     _httpContextAccessor     = httpContextAccessor;
     _singletonValueContainer = singletonValueContainer;
 }
コード例 #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);
        }
コード例 #3
0
 public SetUserIdWhenUserCreatedSubscriber(
     PublishUserCreatedDomainEvent singletonValueContainer)
 {
     _singletonValueContainer = singletonValueContainer;
 }