Esempio n. 1
0
        public async Task ThenTheNameIsMandatory()
        {
            var request = new OrganisationDetailsViewModel();
            var result  = await _orchestrator.ValidateLegalEntityName(request);

            Assert.IsFalse(result.Data.Valid);
            Assert.IsTrue(result.Data.ErrorDictionary.ContainsKey("Name"));
        }
        public async Task <ActionResult> AddOtherOrganisationDetails(OrganisationDetailsViewModel model)
        {
            var response = await _orchestrator.ValidateLegalEntityName(model);

            if (response.Status == HttpStatusCode.BadRequest)
            {
                return(View("AddOtherOrganisationDetails", response));
            }

            model.Type = OrganisationType.Other;

            var addressModel = new OrchestratorResponse <FindOrganisationAddressViewModel>
            {
                Data = _mapper.Map <FindOrganisationAddressViewModel>(response.Data)
            };

            return(View("FindAddress", addressModel));
        }