public async Task <ActionResult> UpdateCurrentUserInfo(UpdateCurrentUserInfoCommand command, CancellationToken token) { await Mediator.Send(command, token); return(NoContent()); }
public void UserNameLengthIsOver30_ShouldHaveError() { _command = new UpdateCurrentUserInfoCommand { UserName = new string('*', 31) }; _sut.ShouldHaveValidationErrorFor(x => x.UserName, _command); }
public void UserNameIsValid_ShouldNotHaveError() { _command = new UpdateCurrentUserInfoCommand { UserName = "******" }; _sut.ShouldNotHaveValidationErrorFor(x => x.UserName, _command); }
public void UserNameIsNullOrEmpty_ShouldHaveError(string userName) { _command = new UpdateCurrentUserInfoCommand { UserName = userName }; _sut.ShouldHaveValidationErrorFor(x => x.UserName, _command); }
public void SetUp() { _service = new Mock <IUpdateCurrentUserInfoService>(); _unitOfWork = new Mock <IUnitOfWork>(); _sut = new UpdateCurrentUserInfoCommandHandler(_service.Object, _unitOfWork.Object); _command = new UpdateCurrentUserInfoCommand { UserName = "******", }; _currentUser = new User("email", "organizationId"); _service.Setup(x => x.GetCurrentUser(default))