public void SetUp() { _service = new Mock <IUncompleteLectureService>(); _unitOfWork = new Mock <IUnitOfWork>(); _sut = new UncompleteLectureCommandHandler(_service.Object, _unitOfWork.Object); _command = new UncompleteLectureCommand("lectureId"); _completedLecture = new LearnerCompletedLecture("learnerId", _command.LectureId); _service.Setup(x => x.GetCompletedLecture(_command.LectureId, default)) .ReturnsAsync(_completedLecture); }
public void LectureIdIsValid_ShouldNotHaveError() { var command = new UncompleteLectureCommand("lectureId"); _sut.ShouldNotHaveValidationErrorFor(x => x.LectureId, command); }
public void LectureIdIsEmptyOrNull_ShouldHaveError(string lectureId) { var command = new UncompleteLectureCommand(lectureId); _sut.ShouldHaveValidationErrorFor(x => x.LectureId, command); }