public ActionResult Edit(Person person)
 {
     if (ModelState.IsValid)
     {
         context.Entry(person).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(person);
 }
        public ActionResult Create(Person person)
        {
            if (ModelState.IsValid)
            {
                context.People.Add(person);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(person);
        }
        public void AddPerson_Should_IncreasePeopleCountBy1()
        {
            // Arrange
            var aPerson = new Person(){Name = "AddPersonTest"};
            var initialCount = _appDb.People.Count();

            // Act
            _appDb.People.Add(aPerson);
            _appDb.SaveChanges();

            // Assert
            var dbCount = _appDb.People.Count();
            Assert.That(dbCount, Is.EqualTo(initialCount + 1), "PeopleCount");
        }
 private Couple GetTestGroup()
 {
     var dude = new Person() { Name = "Dude" };
     var chick = new Person() { Name = "Chick" };
     var group = new Couple();//(dude, chick);
     _appDb.Groups.Add(group);
     _appDb.SaveChanges();
     return group;
 }