コード例 #1
0
        public void GetPostById_ReturnsMatchingPost_WhenIdIsValid()
        {
            SetupMockPost();

            var response = auth.GetPostById(id);

            Assert.AreEqual(title, response.Title);
            Assert.AreEqual(slug, response.Slug);
            Assert.AreEqual(html, response.Html);
        }
コード例 #2
0
        public void GetPostById_ReturnsMatchingPost()
        {
            var post = auth.GetPostById(ValidPost1Id);

            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);
            Assert.IsNull(post.CanonicalUrl);
        }