Esempio n. 1
0
        public async Task <JsonResult> ResetPassword(ResetPasswordRequestJsonModel requestJsonModel)
        {
            var resetPasswordOperationResult = await _userProvider.ResetUserPasswordByToken(
                requestJsonModel.Token,
                requestJsonModel.Password);

            var responseJsonModel = _mapper.Map <ResetPasswordResponseJsonModel>(resetPasswordOperationResult);

            return(Json(responseJsonModel));
        }
        public async Task ResetPasswordActionReturnedJson()
        {
            var request = new ResetPasswordRequestJsonModel
            {
                Password        = "******",
                ConfirmPassword = "******",
                Token           = "123"
            };

            var result = await _controller.ResetPassword(request);

            Assert.IsNotNull(result);
        }
        public async Task ResetPasswordActionReturnedNonSuccessed()
        {
            var request = new ResetPasswordRequestJsonModel
            {
                Password        = "******",
                ConfirmPassword = "******",
                Token           = "123"
            };

            var result = await _controller.ResetPassword(request);

            dynamic jsonData = result.Data;

            Assert.IsFalse(jsonData.Succeeded);
        }