public void Edits_users_profile()
        {
            var user = _authenticationService.User;
            var newProfile = new UserProfile
                                 {
                                     Address = "newAddress",
                                     City = "newCity",
                                     Country = "newCountry",
                                     FirstName = "newFirstName",
                                     LastName = "newLastName",
                                     PostalCode = "newPostalCode"
                                 };

            Assert.AreNotEqual(user.UserProfile.Address, newProfile.Address);
            Assert.AreNotEqual(user.UserProfile.City, newProfile.City);
            Assert.AreNotEqual(user.UserProfile.Country, newProfile.Country);
            Assert.AreNotEqual(user.UserProfile.FirstName, newProfile.FirstName);
            Assert.AreNotEqual(user.UserProfile.LastName, newProfile.LastName);
            Assert.AreNotEqual(user.UserProfile.PostalCode, newProfile.PostalCode);

            var viewModel = new AccountEditViewModel
                                {
                                    UserProfile = newProfile
                                };

            _accountController.Edit(viewModel);

            AssertEx.PropertyValuesAreEquals(newProfile, _authenticationService.User.UserProfile);
        }
        public ActionResult Edit()
        {
            var user = _userRepository.GetUserByEmail(HttpContext.User.Identity.Name);
            var viewModel = new AccountEditViewModel
                                {
                                    UserProfile = user.UserProfile
                                };

            return View(viewModel);
        }
        public ActionResult Edit(AccountEditViewModel model)
        {
            var userEmail = HttpContext.User.Identity.Name;
            _personalizationService.UpdateProfile(userEmail, model.UserProfile);

            return RedirectToAction("List", "Movies");
        }