public void Arrange()
        {
            _mediator = new Mock <IMediator>();
            _mediator.Setup(m => m.SendAsync(It.IsAny <IAsyncRequest <long> >())).ReturnsAsync(TransferConnectionId);

            _controller = new TransferConnectionInvitationsController(null, _mediator.Object);

            _viewModel = new SendTransferConnectionInvitationViewModel
            {
                ReceiverAccountPublicHashedId = "ABC123"
            };
        }
Пример #2
0
        public async Task <ActionResult> Send(SendTransferConnectionInvitationViewModel model)
        {
            switch (model.Choice)
            {
            case "Confirm":
                var transferConnectionInvitationId = await _mediator.SendAsync(new SendTransferConnectionInvitationCommand
                {
                    AccountId = model.AccountId,
                    ReceiverAccountPublicHashedId = model.ReceiverAccountPublicHashedId,
                    UserRef = model.UserRef
                });

                return(RedirectToAction("Sent", new { transferConnectionInvitationId }));

            case "ReEnterAccountId":
                return(RedirectToAction("Start"));

            default:
                throw new ArgumentOutOfRangeException(nameof(model.Choice));
            }
        }