예제 #1
0
 public ActionResult Edit(Company company)
 {
     using (var cm = new CompanyManager())
     {
         company = cm.Edit(company);
     }
     return RedirectToAction("List");
 }
예제 #2
0
        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);
            }
        }