public void DescriptionLengthIsOver100_ShouldHaveError() { _command = new UpdateLearningPathCommand { Description = new string('*', 101) }; _sut.ShouldHaveValidationErrorFor(x => x.Description, _command); }
public void DescriptionIsValid_ShouldNotHaveError() { _command = new UpdateLearningPathCommand { Description = "description" }; _sut.ShouldNotHaveValidationErrorFor(x => x.Description, _command); }
public void NameIsValid_ShouldNotHaveError() { _command = new UpdateLearningPathCommand { Name = "learning path name" }; _sut.ShouldNotHaveValidationErrorFor(x => x.Name, _command); }
public void NameLengthIsOver50_ShouldHaveError() { _command = new UpdateLearningPathCommand { Name = new string('*', 51) }; _sut.ShouldHaveValidationErrorFor(x => x.Name, _command); }
public void NameIsNullOrEmpty_ShouldHaveError(string name) { _command = new UpdateLearningPathCommand { Name = name }; _sut.ShouldHaveValidationErrorFor(x => x.Name, _command); }
public void LearningPathIdIsValid_ShouldNotHaveError() { _command = new UpdateLearningPathCommand { LearningPathId = "learningPathId" }; _sut.ShouldNotHaveValidationErrorFor(x => x.LearningPathId, _command); }
public void LearningPathIdIsNullOrEmpty_ShouldHaveError(string learningPathId) { _command = new UpdateLearningPathCommand { LearningPathId = learningPathId }; _sut.ShouldHaveValidationErrorFor(x => x.LearningPathId, _command); }
public void SetUp() { _service = new Mock <IUpdateLearningPathService>(); _unitOfWork = new Mock <IUnitOfWork>(); _sut = new UpdateLearningPathCommandHandler(_service.Object, _unitOfWork.Object); _command = new UpdateLearningPathCommand { LearningPathId = "learningPathId", Name = "name", Description = "description" }; _learningPathToUpdate = new LearningPath("name", "organizationId"); _service.Setup(x => x.GetLearningPath(_command.LearningPathId, default)) .ReturnsAsync(_learningPathToUpdate); }
public async Task <ActionResult> UpdateLearningPath(UpdateLearningPathCommand command, CancellationToken token) { await Mediator.Send(command, token); return(NoContent()); }