public void RetrievingCompaniesList() { NewPractitionerViewModel vm = new NewPractitionerViewModel(); PractitionerData controller = new PractitionerData(); NewPractitionerViewModel result = controller.GetCompanyList(vm); Assert.IsNotNull(result.CompanyIdList); Assert.IsNotNull(result.CompanyNameList); }
public NewPractitionerViewModel GetCompanyList(NewPractitionerViewModel vm) { NewPractitionerViewModel result = new NewPractitionerViewModel(); try { PractitionerData dataLayer = new PractitionerData(); result = dataLayer.GetCompanyList(vm); //Form key value pair for drop down result.CompanyDropDown = result.CompanyIdList.Zip(result.CompanyNameList, (k, v) => new { k, v }).ToDictionary(x => x.k, x => x.v); } catch (Exception err) { new LogHelper().LogMessage("PractitionerBusiness.GetCompanyList : " + err); } return(result); }