public void GetPostBySlug_ReturnsMatchingPost_WhenSlugIsValid()
        {
            SetupMockPost();

            var response = auth.GetPostBySlug(slug);

            Assert.AreEqual(title, response.Title);
            Assert.AreEqual(slug, response.Slug);
            Assert.AreEqual(html, response.Html);
        }
Exemple #2
0
        public void GetPostBySlug_ReturnsMatchingPost()
        {
            var post = auth.GetPostBySlug(ValidPost1Slug);

            Assert.AreEqual(ValidPost1Id, post.Id);
            Assert.AreEqual(ValidPost1Slug, post.Slug);
            Assert.AreEqual(ValidPost1Title, post.Title);
            Assert.AreEqual(ValidPost1Url, post.Url);

            Assert.IsNotNull(post.Uuid);
            Assert.IsNotNull(post.MobileDoc);
            Assert.IsNotNull(post.CommentId);
            Assert.IsNotNull(post.FeatureImage);
            Assert.IsNotNull(post.MetaDescription);
            Assert.IsNotNull(post.CreatedAt);
            Assert.IsNotNull(post.UpdatedAt);
            Assert.IsNotNull(post.PublishedAt);
            Assert.IsNotNull(post.CustomExcerpt);
            Assert.IsNotNull(post.OgDescription);
            Assert.IsNotNull(post.TwitterDescription);
            Assert.IsNotNull(post.Url);
            Assert.IsNotNull(post.Excerpt);
            Assert.IsNotNull(post.PrimaryAuthor);
            Assert.IsNotNull(post.PrimaryTag);
            Assert.IsNotNull(post.Authors);
            Assert.AreEqual(1, post.Authors.Count);
            Assert.IsNotNull(post.Tags);
            Assert.AreEqual(3, post.Tags.Count);

            Assert.IsNull(post.MetaTitle);
            Assert.IsNull(post.CodeInjectionHead);
            Assert.IsNull(post.CodeInjectionFoot);
            Assert.IsNull(post.OgImage);
            Assert.IsNull(post.OgTitle);
            Assert.IsNull(post.TwitterImage);
            Assert.IsNull(post.TwitterTitle);
            Assert.IsNull(post.CustomTemplate);
            Assert.IsNull(post.Html);
            Assert.IsNull(post.PlainText);
        }