Example #1
0
        public ActionResult EditExercise(int exerciseId, Exercise exercise)
        {
            var result = _exerciseService.Edit(exerciseId, exercise);

            if (result == false)
            {
                return(Forbid());
            }
            return(Ok());
        }
Example #2
0
        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);
        }