Example #1
0
 public void delete_post()
 {
     Config.EnsurePosts();
     Assert.Equal(1, _db.DeleteFrom <Post>("id=@0", 4));
     Assert.Null(_db.Get <Post>(4));
     //  Assert.Equal(9,_db.ExecuteScalar<int>("select count(*) from posts"));
 }
Example #2
0
        public void delete_with_criteria()
        {
            var all = _db.Count <Post>();

            _db.DeleteFrom <Post>(p => new[] { 1, 2 }.Contains(p.Id));
            Assert.Equal(all - 2, _db.Count <Post>());
        }