Exemplo n.º 1
0
        public void Can_Add_New_Lines()
        {
            sut.AddVote(p1);
            sut.AddVote(p2);
            var results = sut.GetVotes.OrderBy(x => x.Name).ToArray();

            Assert.AreEqual(results.Length, 2);
            Assert.AreEqual(results[0], p1);
            Assert.AreEqual(results[1], p2);
        }
Exemplo n.º 2
0
        public ActionResult AddVote(VoteResults votes, int personId, string returnUrl)
        {
            Person person = repository.Table.FirstOrDefault(p => p.PersonId == personId);

            if (person != null)
            {
                votes.AddVote(person);
            }
            //return RedirectToAction("Index", new {returnUrl});
            return(PartialView("Summary", votes));
        }