public void ValidLectureId_ShouldNotHaveError()
        {
            var command = new DeleteLectureCommand {
                LectureId = "lectureId"
            };

            _sut.ShouldNotHaveValidationErrorFor(x => x.LectureId, command);
        }
        public void LectureIdIsEmptyOrNull_ShouldHaveError(string lectureId)
        {
            var command = new DeleteLectureCommand {
                LectureId = lectureId
            };

            _sut.ShouldHaveValidationErrorFor(x => x.LectureId, command);
        }
Example #3
0
        public void SetUp()
        {
            _service       = new Mock <IDeleteLectureService>();
            _commonService = new Mock <ILecturesCommonService>();
            _unitOfWork    = new Mock <IUnitOfWork>();
            _mediator      = new Mock <IMediator>();
            _command       = new DeleteLectureCommand {
                LectureId = "lectureId"
            };
            _sut = new DeleteLectureCommandHandler(_service.Object, _commonService.Object, _unitOfWork.Object,
                                                   _mediator.Object);


            _lectureToDelete = new VideoLecture("title", "moduleId", 1);
            _commonService.Setup(x => x.GetLectureFromRepo(_command.LectureId, default))
            .ReturnsAsync(_lectureToDelete);
        }