public void Can_Delete_Some_Lines() { sut.AddVote(p1); sut.AddVote(p2); sut.RemoveVote(p1); var results = sut.GetVotes.OrderBy(x => x.Name).ToArray(); Assert.AreEqual(results.Length, 1); Assert.AreEqual(results[0], p2); }
public RedirectToRouteResult RemoveVote(VoteResults votes, int personId, string returnUrl) { Person person = repository.Table.FirstOrDefault(p => p.PersonId == personId); if (person != null) { votes.RemoveVote(person); } return(RedirectToAction("Index", new { returnUrl })); }