Exemple #1
0
        public ActionResult SetTransferConnection(SelectTransferConnectionViewModel selectedTransferConnection)
        {
            var transferConnectionCode = selectedTransferConnection.TransferConnectionCode.Equals("None", StringComparison.InvariantCultureIgnoreCase)
                ? null : selectedTransferConnection.TransferConnectionCode;

            return(RedirectToAction("SelectLegalEntity", new SelectLegalEntityRequest {
                AccountHashedId = selectedTransferConnection.AccountHashedId, transferConnectionCode = transferConnectionCode
            }));
        }
Exemple #2
0
        public void Arrange()
        {
            var autoFixture = new Fixture();

            _modelMapper   = new Mock <IModelMapper>();
            _linkGenerator = new Mock <ILinkGenerator>();

            _informRequest   = autoFixture.Create <InformRequest>();
            _informViewModel = autoFixture.Create <SelectTransferConnectionViewModel>();
            _modelMapper.Setup(x => x.Map <SelectTransferConnectionViewModel>(It.Is <InformRequest>(r => r == _informRequest)))
            .ReturnsAsync(_informViewModel);

            _controller = new CohortController(Mock.Of <ICommitmentsApiClient>(),
                                               Mock.Of <ILogger <CohortController> >(),
                                               _linkGenerator.Object,
                                               _modelMapper.Object,
                                               Mock.Of <IAuthorizationService>());
        }
        public async Task <ActionResult> SetTransferConnection(string hashedAccountId, SelectTransferConnectionViewModel selectedTransferConnection)
        {
            if (!ModelState.IsValid)
            {
                var response = await Orchestrator.GetTransferConnections(hashedAccountId, OwinWrapper.GetClaimValue(@"sub"));

                return(View("SelectTransferConnection", response));
            }

            var transferConnectionCode =
                selectedTransferConnection.TransferConnectionCode.Equals("None",
                                                                         StringComparison.InvariantCultureIgnoreCase)
                    ? null
                    : selectedTransferConnection.TransferConnectionCode;

            return(RedirectToAction("SelectLegalEntity", new { transferConnectionCode }));
        }