public void GetPostById_IdDoesNotExist_ReturnsNull()
        {
            var published = new BlogPostPublished
            {
                PageTitle          = "temp",
                BlogPostTemplateId = 15000
            };

            SharedDbContext.Posts.Add(published);
            SharedDbContext.SaveChanges();
            EFBlogPostRepository repo = new EFBlogPostRepository(SharedDbContext);

            var post = repo.GetPostById(15005);

            Assert.IsNull(post);
        }
        public void SavePublishedPost_SaveExistingPost_ChangesRecorded()
        {
            EFBlogPostRepository repo  = new EFBlogPostRepository(SharedDbContext);
            var countBefore            = repo.Posts.Count();
            BlogPostPublished repoPost = repo.Posts
                                         .Where(p => p.PageTitle.ToLower() == "post title no 4").FirstOrDefault();
            int    id         = repoPost.BlogPostTemplateId;
            string newTitle   = "A Completely New Page Title";
            string newContent = "some completely new content";

            repoPost.PageTitle   = newTitle;
            repoPost.FullContent = newContent;

            repo.SavePublishedPost(repoPost);

            var newVals = repo.GetPostById(id);

            Assert.AreEqual(newTitle, newVals.PageTitle);
            Assert.AreEqual(newContent, newVals.FullContent);
        }