public void Check01DirectReferenceOk()
        {

            //SETUP    

            //ATTEMPT
            ICreateServiceAsync<Post> createService = new CreateServiceAsync<Post>(null);
            IDetailServiceAsync<Post> detailService = new DetailServiceAsync<Post>(null);
            IDeleteServiceAsync deleteService = new DeleteServiceAsync(null);
            IUpdateServiceAsync<Post> updateService = new UpdateServiceAsync<Post>(null);

            //VERIFY
            (updateService is IUpdateServiceAsync<Post>).ShouldEqual(true);
        }
        public async void Check11DeleteWithRelationshipsDirectOk()
        {
            using (var db = new SampleWebAppDb())
            {
                //SETUP
                var snap = new DbSnapShot(db);
                var firstPostUntracked = db.Posts.AsNoTracking().First();
                var service = new DeleteServiceAsync(db);

                //ATTEMPT
                var status = await service.DeleteWithRelationshipsAsync<Post>(DeleteBloggerWithPost, firstPostUntracked.PostId);

                //VERIFY
                status.IsValid.ShouldEqual(true, status.Errors);
                status.SuccessMessage.ShouldEqual("Successfully deleted Post and given relationships.");
                snap.CheckSnapShot(db, -1, -2, -1, 0, -2);
            }
        }
        public async void Check12DeleteWithRelationshipsDirectFailOk()
        {
            using (var db = new SampleWebAppDb())
            {
                //SETUP
                var snap = new DbSnapShot(db);
                var firstPostUntracked = db.Posts.AsNoTracking().First();
                var service = new DeleteServiceAsync(db);

                //ATTEMPT
                var status = await service.DeleteWithRelationshipsAsync<Post>(FailDeleteRelationships, firstPostUntracked.PostId);

                //VERIFY
                status.IsValid.ShouldEqual(false);
                status.Errors.Count.ShouldEqual(1);
                status.Errors[0].ErrorMessage.ShouldEqual("I failed.");
                snap.CheckSnapShot(db);
            }
        }
        public void Test41DeleteWithRelationshipsViaDtoBad()
        {
            using (var db = new SampleWebAppDb())
            {
                //SETUP
                var service = new DeleteServiceAsync(db);

                //ATTEMPT
                var ex = Assert.Throws<InvalidOperationException>(async () => await service.DeleteWithRelationshipsAsync<SimplePostDto>(DeleteBloggerWithPostAsync, 0));

                //VERIFY
                ex.Message.ShouldEqual("The entity type SimplePostDto is not part of the model for the current context.");
            }
        }