Пример #1
0
        public async Task ChangePasswordShouldCallUserQueryWithCurrentUserAsync()
        {
            // arrange
            var user = new UserEntity {
                Id = Guid.NewGuid()
            };

            _securityContextMock.SetupGet(x => x.UserEntity).Returns(user);

            var model = new ChangeUserPasswordModel {
                Password = _random.Next().ToString()
            };

            _userQueryProcessorMock.Setup(x => x.ChangePassword(user.Id, model))
            .Returns(Task.FromResult(0))
            .Verifiable();

            // act
            await _accountQueryProcessor.ChangePassword(model);

            // assert
            _userQueryProcessorMock.Verify();
        }
 public IActionResult ChangePassword([FromBody] ChangeUserPasswordModel model)
 {
     _accountQuery.ChangePassword(model);
     return(Ok());
 }