public void D_UpdateWorkoutCategoryTest() { var catName = "TestServicecategory"; var catList = workoutCategoryService.GetWorkoutCategories().Where(x => x.category_name.Equals(catName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); if (catList != null) { catList.category_name = "TestServicecategoryUpdated"; workoutCategoryService.UpdateWorkoutCategory(catList); var result = workoutCategoryService.GetAll().Where(x => x.category_name.Equals("TestServicecategoryUpdated", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); Assert.AreNotEqual("TestServicecategory", result.category_name); } }
public HttpResponseMessage UpdateCategory(WorkoutCategory wc) { WorkoutCategory result = new WorkoutCategory(); try { wc.workout_collection = null; var input = Helper.CastObject <workout_category>(wc); var res = _workoutCategoryService.UpdateWorkoutCategory(input); MapCategory(res, ref result); } catch (Exception ex) { _logManager.WriteLog(ex); } return(ToJson(result)); }