Ejemplo n.º 1
0
        public async Task <ActionResult> UpdateCurrentUserInfo(UpdateCurrentUserInfoCommand command,
                                                               CancellationToken token)
        {
            await Mediator.Send(command, token);

            return(NoContent());
        }
Ejemplo n.º 2
0
        public void UserNameLengthIsOver30_ShouldHaveError()
        {
            _command = new UpdateCurrentUserInfoCommand {
                UserName = new string('*', 31)
            };

            _sut.ShouldHaveValidationErrorFor(x => x.UserName, _command);
        }
Ejemplo n.º 3
0
        public void UserNameIsValid_ShouldNotHaveError()
        {
            _command = new UpdateCurrentUserInfoCommand {
                UserName = "******"
            };

            _sut.ShouldNotHaveValidationErrorFor(x => x.UserName, _command);
        }
Ejemplo n.º 4
0
        public void UserNameIsNullOrEmpty_ShouldHaveError(string userName)
        {
            _command = new UpdateCurrentUserInfoCommand {
                UserName = userName
            };

            _sut.ShouldHaveValidationErrorFor(x => x.UserName, _command);
        }
Ejemplo n.º 5
0
        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))