public ActionResult EditExercise(int exerciseId, Exercise exercise) { var result = _exerciseService.Edit(exerciseId, exercise); if (result == false) { return(Forbid()); } return(Ok()); }
public void ExerciseEdit() { var exerciseId = ExerciseCreate(); _exerciseService.Edit(exerciseId, new Exercise { Name = "xxx", Content = "yyy" }); var exercise = _exerciseService.Get(exerciseId); Assert.Equal("xxx", exercise.Name); Assert.Contains("yyy", exercise.Content); }