public ActionResult Delete(int inviteeId)
        {
            Invitee invitee = Invitee.Find(inviteeId);

            invitee.Delete();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public void Delete_DeletesInviteeFromDatabase()
        {
            //Arrange
            string  inviteeName         = "Jane Doe";
            string  inviteeEmailAddress = "*****@*****.**";
            Invitee newInvitee          = new Invitee(inviteeName, inviteeEmailAddress);

            newInvitee.Save();
            newInvitee.Delete();

            //Act
            List <Invitee> newList = new List <Invitee> {
                newInvitee
            };
            List <Invitee> resultList = Invitee.GetAll();

            //Assert
            CollectionAssert.AreNotEqual(newList, resultList);
        }