Ejemplo n.º 1
0
        public void Check12DeleteEfDirectOk()
        {
            int postId;
            using (var db = new SampleWebAppDb())
                postId = db.Posts.AsNoTracking().First().PostId;

            using (var db = new SampleWebAppDb())
            {
                //SETUP
                var timer = new Stopwatch();
                timer.Start();

                //ATTEMPT
                db.DeletePostEfDirect(postId);
                timer.Stop();

                //VERIFY
                Console.WriteLine("Ef operation took {0} ms", timer.ElapsedMilliseconds);
            }
        }
        public void Check12DeleteEfDirectOk()
        {
            using (var db = new SampleWebAppDb())
            {
                //SETUP
                var snap = new DbSnapShot(db);
                var id = db.Posts.AsNoTracking().First().PostId;

                //ATTEMPT
                db.DeletePostEfDirect(id);

                //VERIFY
                db.Posts.Count().ShouldEqual(snap.NumPosts - 1);
            }
        }