public async Task <ActionResult> Receive(GetReceivedTransferConnectionInvitationQuery query)
        {
            var response = await _mediator.SendAsync(query);

            var model = _mapper.Map <ReceiveTransferConnectionInvitationViewModel>(response);

            return(View(model));
        }
        public void Arrange()
        {
            _db = new Mock <EmployerAccountsDbContext>();

            _senderAccount = new Account
            {
                Id       = 333333,
                HashedId = "ABC123",
                Name     = "Sender"
            };

            _receiverAccount = new Account
            {
                Id       = 222222,
                HashedId = "XYZ987",
                Name     = "Receiver"
            };

            _receivedTransferConnectionInvitation = new TransferConnectionInvitationBuilder()
                                                    .WithId(111111)
                                                    .WithSenderAccount(_senderAccount)
                                                    .WithReceiverAccount(_receiverAccount)
                                                    .WithStatus(TransferConnectionInvitationStatus.Pending)
                                                    .Build();

            _rejectedTransferConnectionInvitation = new TransferConnectionInvitationBuilder()
                                                    .WithId(111111)
                                                    .WithSenderAccount(_senderAccount)
                                                    .WithReceiverAccount(_receiverAccount)
                                                    .WithStatus(TransferConnectionInvitationStatus.Rejected)
                                                    .Build();

            _transferConnectionInvitations = new List <TransferConnectionInvitation> {
                _receivedTransferConnectionInvitation, _rejectedTransferConnectionInvitation
            };
            _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 GetReceivedTransferConnectionInvitationQueryHandler(new Lazy <EmployerAccountsDbContext>(() => _db.Object), _configurationProvider);

            _query = new GetReceivedTransferConnectionInvitationQuery
            {
                AccountId = _receiverAccount.Id,
                TransferConnectionInvitationId = _receivedTransferConnectionInvitation.Id
            };
        }
 public ActionResult Receive(GetReceivedTransferConnectionInvitationQuery query)
 {
     return(Redirect(Url.EmployerAccountsAction($"transfers/connections/requests/{query.TransferConnectionInvitationId}/receive")));
 }