public ActionResult Edit(Company company) { using (var cm = new CompanyManager()) { company = cm.Edit(company); } return RedirectToAction("List"); }
public void EditCompanyTest() { Company company; using (var cm = new CompanyManager()) { company = cm.Single(1); } var oldTime = company.ModifiedOn; company.ModifiedOn = DateTime.Now; using (var cm = new CompanyManager()) { company = cm.Edit(company); } using(var cm = new CompanyManager()) { var company2 = cm.Single(1); Assert.IsTrue(company2.ModifiedOn > oldTime); } }