public void TestDelete2() { var n = SoftDelete.GetCount(Condition.Empty); var o = new SoftDelete { Name = "aaa" }; o.Name = "bbb"; o.Save(); var o2 = new SoftDelete { Name = "ccc" }; o2.Save(); var m = SoftDelete.GetCount(Condition.Empty); Assert.AreEqual(2, m - n); o2.Delete(); m = SoftDelete.GetCount(Condition.Empty); Assert.AreEqual(1, m - n); }
public void TestUpdate() { SoftDelete o = SoftDelete.FindById(1); Assert.AreEqual("tom", o.Name); o.Name = "oh"; o.Save(); o = SoftDelete.FindById(1); Assert.AreEqual("oh", o.Name); }
public void TestInsert() { var o = new SoftDelete { Name = "test" }; o.Save(); SoftDeleteFull o1 = SoftDeleteFull.FindById(o.Id); Assert.AreEqual("test", o1.Name); Assert.AreEqual(false, o1.IsDeleted); }