public ActionResult Edit(Account toEdit) { _repository.Update(toEdit); return RedirectToAction("Index"); }
public void Should_link_account_to_multiple_debits() { var account = new Account("Test"); account.Debits.Add(new Debit("Test1", "02/02/2012", 22.00)); account.Debits.Add(new Debit("Test2", "02/02/2012", 27.00)); _repo.AddNew(account); var retrieved = _repo.GetByName("Test"); retrieved.Debits.FirstOrDefault(d=>d.Name == "Test1").Amount.ShouldBe(22.00); retrieved.Debits.FirstOrDefault(d => d.Name == "Test2").Amount.ShouldBe(27.00); }
public PartialViewResult AddNew() { var toCreate = new Account(""); return PartialView("Edit", toCreate); }