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

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

            return(View(model));
        }
Ejemplo n.º 2
0
        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"
            };

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

            _query = new GetRejectedTransferConnectionInvitationQuery
            {
                AccountId = _receiverAccount.Id,
                TransferConnectionInvitationId = _rejectedTransferConnectionInvitation.Id
            };
        }
 public ActionResult Rejected(GetRejectedTransferConnectionInvitationQuery query)
 {
     return(Redirect(Url.EmployerAccountsAction($"transfers/connections/requests/{query.TransferConnectionInvitationId}/rejected")));
 }