Exemple #1
0
        public void TestRead1()
        {
            SoftDelete o = SoftDelete.FindById(1);

            Assert.AreEqual("tom", o.Name);
            o = SoftDelete.FindById(4);
            Assert.IsNull(o);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public void TestDeleteAll()
        {
            SoftDelete.DeleteBy(Condition.Empty);
            var o = SoftDelete.FindById(1);

            Assert.IsNull(o);

            SoftDeleteFull o1 = SoftDeleteFull.FindById(1);

            Assert.IsNotNull(o1);
            Assert.AreEqual("tom", o1.Name);
            Assert.AreEqual(true, o1.IsDeleted);
        }
Exemple #4
0
        public void TestDelete()
        {
            SoftDelete o = SoftDelete.FindById(1);

            o.Delete();
            o = SoftDelete.FindById(1);
            Assert.IsNull(o);

            SoftDeleteFull o1 = SoftDeleteFull.FindById(1);

            Assert.IsNotNull(o1);
            Assert.AreEqual("tom", o1.Name);
            Assert.AreEqual(true, o1.IsDeleted);
        }