Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }