public void HostUserTearDown() { hostUserViewModel = new HostUserViewModel { ID = hostUser.Id, UserName = "******", }; hostUserAppService.UpdateHostUser(hostUserViewModel); }
public ActionResult Edit(HostUserViewModel updateHostUser) { if (ModelState.IsValid) { hostAppService.UpdateHostUser(updateHostUser); return(RedirectToAction("Details", new { id = updateHostUser.ID })); } return(View(updateHostUser)); }
public void Test_Update_Host_UserName() { hostUserViewModel = new HostUserViewModel { ID = hostUser.Id, UserName = "******", }; hostUserUpdated = hostUserAppService.UpdateHostUser(hostUserViewModel); Assert.That(hostUserUpdated.user.UserName, Is.EqualTo(hostUserViewModel.UserName)); }
public HostUser UpdateHostUser(HostUserViewModel hostUserVM) { HostUser hostUser = TheUnitOfWork.Host.GetHostById(hostUserVM.ID); hostUser.user.UserName = hostUserVM.UserName; hostUser.user.Email = hostUserVM.Email; hostUser.user.age = hostUserVM.Age; hostUser.user.address = hostUserVM.Address; TheUnitOfWork.Host.UpdateHostUser(hostUser); return(hostUser); }
public HostUserViewModel GetHostById(string id) { HostUser hostUser = TheUnitOfWork.Host.GetHostById(id); HostUserViewModel hostUserVM = new HostUserViewModel(); hostUserVM.ID = hostUser.Id; hostUserVM.UserName = hostUser.user.UserName; hostUserVM.Email = hostUser.user.Email; hostUserVM.Age = hostUser.user.age; hostUserVM.Address = hostUser.user.address; return(hostUserVM); }
public ActionResult Edit(string id) { HostUserViewModel hostUserVM = hostAppService.GetHostById(id); return(View(hostUserVM)); }