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

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

            return(View(model));
        }
Example #2
0
        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();

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

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

            _query = new GetSentTransferConnectionInvitationQuery
            {
                AccountId = _senderAccount.Id,
                TransferConnectionInvitationId = _sentTransferConnectionInvitation.Id
            };
        }
 public ActionResult Sent(GetSentTransferConnectionInvitationQuery query)
 {
     return(Redirect(Url.EmployerAccountsAction($"transfers/connections/requests/{query.TransferConnectionInvitationId}/sent")));
 }