public async Task Handle(CommentDeletedEvent notification, CancellationToken cancellationToken)
    {
        var comment = await _readModelRepository.GetAsync <CommentDetail>(notification.AggregateId);

        comment.When(notification);

        await _readModelRepository.UpdateAsync(comment);
    }
示例#2
0
        public async Task Handle_Success()
        {
            // Arrange
            var notification = new CommentDeletedEvent(validCommentId);

            // Act
            await policy.Handle(notification, CancellationToken.None);

            // Assert
            A.CallTo(() => telemetryService.TrackEvent(TelemetryEventNames.DeleteEventComment, notification))
            .MustHaveHappenedOnceExactly();
        }
示例#3
0
 private void When(CommentDeletedEvent @event)
 {
     _isDeleted = true;
 }
示例#4
0
 public void When(CommentDeletedEvent @event)
 {
     IsDeleted = true;
 }