public async Task <ActionResult> RemoveLearningPathCourse(RemoveCourseFromLearningPathCommand command,
                                                                  CancellationToken token)
        {
            await Mediator.Send(command, token);

            return(NoContent());
        }
        public void CourseIdIsValid_ShouldNotHaveError()
        {
            _command = new RemoveCourseFromLearningPathCommand {
                CourseId = "courseId"
            };

            _sut.ShouldNotHaveValidationErrorFor(x => x.CourseId, _command);
        }
        public void CourseIdIsNullOrEmpty_ShouldHaveError(string courseId)
        {
            _command = new RemoveCourseFromLearningPathCommand {
                CourseId = courseId
            };

            _sut.ShouldHaveValidationErrorFor(x => x.CourseId, _command);
        }
Exemple #4
0
        public void SetUp()
        {
            _service    = new Mock <IRemoveCourseFromLearningPathService>();
            _unitOfWork = new Mock <IUnitOfWork>();
            _sut        = new RemoveCourseFromLearningPathCommandHandler(_service.Object, _unitOfWork.Object);

            _command = new RemoveCourseFromLearningPathCommand
            {
                LearningPathId = "learningPathId", CourseId = "courseId"
            };

            _learningPathCourseToDelete = new LearningPathCourse("learningPathId", "courseId", 1);
            _service.Setup(x => x.GetLearningPathCourseFromRepo(_command.LearningPathId, _command.CourseId, default))
            .ReturnsAsync(_learningPathCourseToDelete);
        }