public async Task GivenVacancyReviewReferredVacancyEvent_VerifyCommunicationRequestIsSentToCommunicationQueue()
        {
            var sourceEvent = new VacancyReferredEvent
            {
                VacancyReference = ReferredVacancyReferenceNumber,
                VacancyId        = _exampleVacancyId
            };
            var @event = JsonConvert.SerializeObject(sourceEvent);

            await _sut.HandleAsync(@event);

            _mockCommunicationQueueService.Verify(x => x.AddMessageAsync(It.IsAny <CommunicationRequest>()), Times.Once);
        }
        public async Task GivenVacancyReviewReferredVacancyEvent_VerifyCommunicationRequestHasExpectedData()
        {
            var sourceEvent = new VacancyReferredEvent
            {
                VacancyReference = ReferredVacancyReferenceNumber,
                VacancyId        = _exampleVacancyId
            };
            var @event = JsonConvert.SerializeObject(sourceEvent);

            await _sut.HandleAsync(@event);

            _sentCommRequest
            .Entities
            .Any(cr => cr.EntityType.Equals(CommunicationConstants.EntityTypes.Vacancy) && ((long)cr.EntityId == ReferredVacancyReferenceNumber))
            .Should()
            .BeTrue();
        }
 public Task Handle(VacancyReferredEvent notification, CancellationToken cancellationToken)
 {
     return(Handle(notification));
 }
コード例 #4
0
 public Task Handle(VacancyReferredEvent notification, CancellationToken cancellationToken)
 => HandleUsingEventStore(notification);