public async Task ResetPassword_UserResetsPassword_ReturnsOk()
        {
            var registration = new Mock <IRegistration>();

            registration.Setup(register => register.ResetUserPassword(new ResetPassword())).ReturnsAsync("New password updated successfully...");

            var forgotPasswordController = new ForgotPasswordController(registration.Object);

            var result = await forgotPasswordController.ResetPassword(new ResetPassword());

            var okResult = new OkObjectResult(result);

            Assert.AreEqual(200, okResult.StatusCode);
        }
        public async Task ResetPassword_UserUnableToResetPassword_ReturnsNotFound()
        {
            var registration = new Mock <IRegistration>();

            registration.Setup(register => register.ResetUserPassword(new ResetPassword())).ReturnsAsync("Account doesn't exist...");

            var forgotPasswordController = new ForgotPasswordController(registration.Object);

            var result = await forgotPasswordController.ResetPassword(new ResetPassword());

            var notFoundResult = new NotFoundObjectResult(result);

            Assert.AreEqual(404, notFoundResult.StatusCode);
        }
        public void ResetPassword_Failed()
        {
            //Arrenge
            ForgotPassword_Failed();
            ForgotPasswordController forgotPasswordController = new ForgotPasswordController(forgotPasswordDataProvider);

            //Act
            var getForgotPasswordResult = forgotPasswordController.ResetPassword(emptyResetPasswordModel);
            var response = getForgotPasswordResult as HttpResult <Response <ResetPasswordModel> >;

            //Assert
            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Value);
            Assert.IsTrue(response.Value.DataItems.Count == 0);
            Assert.IsTrue(response.Value.RowAffected == 0);
        }
        public void ResetPassword_Success()
        {
            //Arrenge
            ForgotPassword_Success();
            ForgotPasswordController forgotPasswordController = new ForgotPasswordController(forgotPasswordDataProvider);

            //Act
            var getForgotPasswordResult = forgotPasswordController.ResetPassword(resetPasswordModel);
            var response = getForgotPasswordResult as HttpResult <Response <ResetPasswordModel> >;

            //Assert
            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Value);
            Assert.IsNotNull(response.Value.DataItems, "Data items can't be null");
            Assert.IsTrue(response.Value.RowAffected > 0);
        }