예제 #1
0
        public async Task HandleAsync_Should_Complete_Account_Deletion_With_Success_When_UserDeletionCompletedIntegrationEvent_Is_Received()
        {
            var userDeletionCompletedIntegrationEvent = new UserDeletionCompletedIntegrationEvent(Guid.NewGuid(), DateTimeOffset.UtcNow, Guid.NewGuid());

            _integrationEventBusMock.Setup(x => x.PublishIntegrationEventAsync(It.IsAny <IIntegrationEvent>()))
            .Returns(Task.CompletedTask)
            .Verifiable();


            Func <Task> result = async() => await _userDeletionCompletedIntegrationEvent.HandleAsync(userDeletionCompletedIntegrationEvent);

            await result.Should().NotThrowAsync <Exception>();

            _integrationEventBusMock.Verify(x => x.PublishIntegrationEventAsync(It.Is <IIntegrationEvent>(ie =>
                                                                                                          IsPublishedIntegrationEventCorrect((AccountDeletionCompletedIntegrationEvent)ie, userDeletionCompletedIntegrationEvent.CorrelationId,
                                                                                                                                             userDeletionCompletedIntegrationEvent.UserId))));
        }
예제 #2
0
        public Task HandleAsync(AnnouncementPreferencesDeletionCompletedIntegrationEvent integrationEvent, CancellationToken cancellationToken = default)
        {
            var userDeletionCompletedIntegrationEvent = new UserDeletionCompletedIntegrationEvent(integrationEvent.CorrelationId, integrationEvent.UserId);

            return(_integrationEventBus.PublishIntegrationEventAsync(userDeletionCompletedIntegrationEvent));
        }