public ActionResult Update(int inviteeId, string inviteeName, string inviteeEmailAddress) { Invitee invitee = Invitee.Find(inviteeId); invitee.Edit(inviteeName, inviteeEmailAddress); return(RedirectToAction("Index")); }
public void Edit_UpdatesInviteeToDatabase() { //Arrange string inviteeName = "Jane Doe"; string inviteeEmailAddress = "*****@*****.**"; Invitee newInvitee = new Invitee(inviteeName, inviteeEmailAddress); newInvitee.Save(); //Act Invitee foundInvitee = Invitee.Find(newInvitee.GetId()); string newInviteeName = "John Smith"; string newInviteeEmailAddress = "*****@*****.**"; foundInvitee.Edit(newInviteeName, newInviteeEmailAddress); Invitee updatedInvitee = Invitee.Find(newInvitee.GetId()); List <Invitee> result = Invitee.GetAll(); List <Invitee> testList = new List <Invitee> { updatedInvitee }; //Assert CollectionAssert.AreEqual(testList, result); }