Exemplo n.º 1
0
 private static int ResetDatabaseNPost(int numToPutInDatabase)
 {
     using (var db = new SampleWebAppDb())
     {
         db.FillComputedNPost(numToPutInDatabase);
         return(db.Posts.Min(x => x.PostId));
     }
 }
        public void Check02FillComputedNPostOk()
        {
            using (var db = new SampleWebAppDb())
            {
                //SETUP
                const int numToCreate = 20;
                var       snap        = new DbSnapShot(); //empty

                //ATTEMPT
                db.FillComputedNPost(numToCreate);

                //VERIFY
                snap.CheckSnapShot(db, numToCreate, numToCreate, 2, 2);
                (db.Posts.Max(x => x.PostId) - db.Posts.Min(x => x.PostId)).ShouldEqual(numToCreate - 1);       //check numbers are consecutive
            }
        }