public async Task Then_the_KeyNotFoundException_is_thrown_when_no_incentive_is_found_for_this_uln_and_accountlegalentityid() { var command = _fixture.Create <PausePaymentsCommand>(); Func <Task> act = async() => await _sut.Handle(command); act.Should().Throw <KeyNotFoundException>(); }
public async Task Then_the_PausePayments_flag_for_this_incentive_is_set_off() { // Arrange var command = CreatePausedPaymentsCommandWithActionResume(); var apprenticeshipIncentive = CreateApprenticeshipIncentive(true); _mockDomainRepository .Setup(x => x.FindByUlnWithinAccountLegalEntity(command.ULN, command.AccountLegalEntityId)) .ReturnsAsync(apprenticeshipIncentive); // Act await _sut.Handle(command); // Assert _mockDomainRepository.Verify(x => x.Save(It.Is <Domain.ApprenticeshipIncentives.ApprenticeshipIncentive>(x => x.PausePayments == false)), Times.Once); }