public async Task <ActionResult> Approved(GetApprovedTransferConnectionInvitationQuery query) { var response = await _mediator.SendAsync(query); var model = _mapper.Map <ApprovedTransferConnectionInvitationViewModel>(response); return(View(model)); }
public void Arrange() { _db = new Mock <EmployerAccountsDbContext>(); _senderAccount = new Account { Id = 444444, HashedId = "ABC123", Name = "Sender" }; _receiverAccount = new Account { Id = 333333, HashedId = "XYZ987", Name = "Receiver" }; _sentTransferConnectionInvitation = new TransferConnectionInvitationBuilder() .WithId(222222) .WithSenderAccount(_senderAccount) .WithReceiverAccount(_receiverAccount) .WithStatus(TransferConnectionInvitationStatus.Pending) .Build(); _approvedTransferConnectionInvitation = new TransferConnectionInvitationBuilder() .WithId(111111) .WithSenderAccount(_senderAccount) .WithReceiverAccount(_receiverAccount) .WithStatus(TransferConnectionInvitationStatus.Approved) .Build(); _transferConnectionInvitations = new List <TransferConnectionInvitation> { _sentTransferConnectionInvitation, _approvedTransferConnectionInvitation }; _transferConnectionInvitationsDbSet = new FakeDbSet <TransferConnectionInvitation>(_transferConnectionInvitations); _configurationProvider = new MapperConfiguration(c => { c.AddProfile <AccountMappings>(); c.AddProfile <TransferConnectionInvitationMappings>(); c.AddProfile <UserMappings>(); }); _db.Setup(d => d.TransferConnectionInvitations).Returns(_transferConnectionInvitationsDbSet); _handler = new GetApprovedTransferConnectionInvitationQueryHandler(new Lazy <EmployerAccountsDbContext>(() => _db.Object), _configurationProvider); _query = new GetApprovedTransferConnectionInvitationQuery { AccountId = _receiverAccount.Id, TransferConnectionInvitationId = _approvedTransferConnectionInvitation.Id }; }
public ActionResult Approved(GetApprovedTransferConnectionInvitationQuery query) { return(Redirect(Url.EmployerAccountsAction($"transfers/connections/requests/{query.TransferConnectionInvitationId}/approved"))); }