public ApproveTransferRequestCommandHandlerTestsFixture SetupTransferSenderApproveCohortCommand(long transferRequestId = 0) { if (transferRequestId == 0) { transferRequestId = TransferRequest.Id; } TransferSenderApproveCohortCommand = new ApproveTransferRequestCommand(transferRequestId, Now, TransferSenderUserInfo); return(this); }
public void Setup() { _target = new ApproveTransferRequestValidator(); _command = new ApproveTransferRequestCommand { CommitmentId = 123, TransferSenderId = 999, TransferReceiverId = 777, UserEmail = "*****@*****.**", UserName = "******" }; }
public void SetUp() { _validator = new ApproveTransferRequestValidator(); _commitmentRepository = new Mock <ICommitmentRepository>(); _v2EventsPublisher = new Mock <IV2EventsPublisher>(); var fixture = new Fixture(); _command = fixture.Build <ApproveTransferRequestCommand>().Create(); _commitment = fixture.Build <Commitment>() .With(x => x.TransferSenderId, _command.TransferSenderId) .With(x => x.EmployerAccountId, _command.TransferReceiverId) .With(x => x.TransferApprovalStatus, TransferApprovalStatus.Pending) .With(x => x.EditStatus, EditStatus.Both).Create(); _commitmentRepository.Setup(x => x.GetCommitmentById(It.IsAny <long>())).ReturnsAsync(_commitment); _commitment.Apprenticeships.ForEach(x => x.AgreementStatus = AgreementStatus.ProviderAgreed); _sut = new ApproveTransferRequestCommandHandler(_validator, _commitmentRepository.Object, _v2EventsPublisher.Object); }
public Task SendApproveTransferRequestCommand(long transferRequestId, DateTime approvedOn, UserInfo userInfo) { var command = new ApproveTransferRequestCommand(transferRequestId, approvedOn, userInfo); return(SendCommandAndLog(command, $"TransferRequest Id {transferRequestId} approved")); }