public void TestGetCatalogs() { //Test get by Id CatalogBL catalogBL = new CatalogBL(connectionString); List <SelectableModel> brands = catalogBL.GetAgriculturalBrands(); Assert.IsTrue(brands.Count() > 0); List <SelectableModel> civilStatus = catalogBL.GetCivilStatus(); Assert.IsTrue(civilStatus.Count() > 0); List <SelectableModel> genders = catalogBL.GetGenders(); Assert.IsTrue(genders.Count() > 0); List <SelectableModel> presentations = catalogBL.GetPresentations(); Assert.IsTrue(presentations.Count() > 0); List <SelectableModel> productGroups = catalogBL.GetProductGroups(); Assert.IsTrue(productGroups.Count() > 0); List <SelectableModel> regimes = catalogBL.GetRegimes(); Assert.IsTrue(regimes.Count() > 0); List <SelectableModel> units = catalogBL.GetUnits(); Assert.IsTrue(units.Count() > 0); List <SelectableModel> states = catalogBL.GetStates(); Assert.IsTrue(states.Count() > 0); }
public IHttpActionResult GetProductGroups() { GetSelectableModelResponse response = new GetSelectableModelResponse(); try { List <SelectableModel> groups = catalogBL.GetProductGroups(); response.SelectableModels = groups; response.Success = true; } catch (Exception ex) { response.ErrorMessage = "Error. " + ex.Message; response.Success = false; } return(Ok(response)); }