public void ShouldThrowValidationErrorIfChangeDateGreaterThanTodayForLiveApprenticeship() { _validCommand.DateOfChange = DateTime.UtcNow.AddMonths(1); // Change date in the future Func <Task> act = async() => await _handler.Handle(_validCommand); act.ShouldThrow <InvalidRequestException>().Which.Message.Contains("Date must be a date in the past"); }
public async Task ThenTheCommitmentApiShouldBeCalledWithCorrectStatus(ChangeStatusType type, PaymentStatus expectedStatus) { _validCommand.ChangeType = type; await _handler.Handle(_validCommand); _mockCommitmentApi.Verify(x => x.PatchEmployerApprenticeship( _validCommand.EmployerAccountId, _validCommand.ApprenticeshipId, It.Is <ApprenticeshipSubmission>( y => y.PaymentStatus == expectedStatus && y.LastUpdatedByInfo.Name == _validCommand.UserDisplayName && y.LastUpdatedByInfo.EmailAddress == _validCommand.UserEmailAddress))); }
public async Task ShouldSendProviderNotification() { await _handler.Handle(_validCommand); _providerEmailNotificationService.Verify(x => x.SendProviderApprenticeshipResumeNotification(It.Is <Apprenticeship>(a => a == _testApprenticeship), It.Is <DateTime>(d => d == _validCommand.DateOfChange)) , Times.Once); }