public void TestAdd() { Model.Customer_AutoIncrease Customer = new Model.Customer_AutoIncrease(); Customer.Name = "test1"; Customer.Age = "10"; Customer.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"); Customer.Save(); Assert.IsNotNull(Model.Customer_AutoIncrease.CreateHelper().IsExists("Name='test1'")); }
public void TestUpdate() { Model.Customer_AutoIncrease Customer = new Model.Customer_AutoIncrease(); Customer.Name = "test2"; Customer.Age = "10"; Customer.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"); Customer.ID = Customer.Save().ToString(); Customer.Age = "20"; Customer.Update(); Model.Customer_AutoIncrease CustomerTemp = Model.Customer_AutoIncrease.CreateHelper().Where("Name='Test2'").GetModel(); Assert.AreEqual <string>("20", Customer.Age); }
//[TestMethod] public void TestAddTrans() { Transaction objTrans = new Transaction(); objTrans.Begin(); Model.Customer_AutoIncrease Customer = new Model.Customer_AutoIncrease(); Customer.Name = "test3"; Customer.Age = "10"; Customer.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"); Customer.Save(objTrans); objTrans.RollBack(); Assert.IsNull(Model.Customer_AutoIncrease.CreateHelper().IsExists("Name='test3'")); }