public ActionResult Delete(int id, FormCollection collection) { var projectUser = ProjectUserRepository.ProjectUserFetch(id); ProjectUserRepository.ProjectUserDelete(id); return(this.RedirectToAction("Details", "Project", new { id = projectUser.ProjectId })); }
public void ProjectUser_Delete() { var projectUserMember = ProjectUserTestHelper.ProjectUserNew(); Assert.IsTrue(projectUserMember.IsValid, "IsValid should be true"); projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember); projectUserMember = ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId); ProjectUserRepository.ProjectUserDelete(projectUserMember.ProjectUserMemberId); try { ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }