public async Task GivenVacancyReviewedEvent_VerifyCommunicationRequestIsSentToCommunicationQueue() { //Arrange var sourceEvent = new VacancyReviewedEvent { EmployerAccountId = _employerAccountId, VacancyReference = _vacancyReference, VacancyId = _exampleVacancyId, Ukprn = _exampleUkprn }; var @event = JsonConvert.SerializeObject(sourceEvent); //Act await _sut.HandleAsync(@event); //Assert _mockCommunicationQueueService.Verify(x => x.AddMessageAsync(It.IsAny <CommunicationRequest>()), Times.Once); }
public async Task GivenVacancyReviewedEvent_VerifyCommunicationRequestHasExpectedData() { //Arrange var sourceEvent = new VacancyReviewedEvent { EmployerAccountId = _employerAccountId, VacancyReference = _vacancyReference, VacancyId = _exampleVacancyId, Ukprn = _exampleUkprn }; var @event = JsonConvert.SerializeObject(sourceEvent); //Act await _sut.HandleAsync(@event); //Assert _sentCommRequest .Entities .Any(cr => cr.EntityType.Equals(CommunicationConstants.EntityTypes.Vacancy) && ((long)cr.EntityId == _vacancyReference)) .Should() .BeTrue(); }
public Task Handle(VacancyReviewedEvent notification, CancellationToken cancellationToken) { return(Handle(notification)); }
public Task Handle(VacancyReviewedEvent notification, CancellationToken cancellationToken) => HandleUsingEventStore(notification);