Ejemplo n.º 1
0
        public static BloggerPostData GetPost(
            int index,
            int tagCount = BlogPostTestData.DefaultTagCount,
            string blogKey = BlogMetaTestData.BlogKey)
        {
            var authorImage = new BloggerPostData.AuthorData.ImageData
                                  {
                                      Url =
                                          TestUtility.GetTestString(
                                              $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.AuthorData)}.{nameof(BloggerPostData.AuthorData.ImageData)}.{nameof(BloggerPostData.AuthorData.ImageData.Url)}",
                                              blogKey,
                                              index)
                                  };
            var author = new BloggerPostData.AuthorData
                             {
                                 Id =
                                     TestUtility.GetTestString(
                                         $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.AuthorData)}.{nameof(BloggerPostData.AuthorData.Id)}",
                                         blogKey,
                                         index),
                                 Image = authorImage,
                                 DisplayName =
                                     TestUtility.GetTestString(
                                         $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.AuthorData)}.{nameof(BloggerPostData.AuthorData.DisplayName)}",
                                         blogKey,
                                         index),
                                 Url =
                                     TestUtility.GetTestString(
                                         $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.AuthorData)}.{nameof(BloggerPostData.AuthorData.Url)}",
                                         blogKey,
                                         index)
                             };

            var post = new BloggerPostData
                           {
                               Author = author,
                               Content =
                                   TestUtility.GetTestString(
                                       $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.Content)}",
                                       blogKey,
                                       index),
                               Id = BlogPostTestData.CreatePostSourceId(index, blogKey),
                               Labels = BlogPostTestData.CreatePostTags(index, tagCount).ToList(),
                               Published = PostPublishedAt.AddDays(index),
                               Title =
                                   TestUtility.GetTestString(
                                       $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.Title)}",
                                       blogKey,
                                       index),
                               Url =
                                   TestUtility.GetTestString(
                                       $"{nameof(BloggerPostData)}.{nameof(BloggerPostData.Url)}",
                                       blogKey,
                                       index),
                               Updated = PostUpdatedAt.AddDays(index)
                           };
            return post;
        }
Ejemplo n.º 2
0
        public static IEnumerable<BloggerPostData> GetPosts()
        {
            var authorImage = new BloggerPostData.AuthorData.ImageData { Url = AuthorImageUrl };
            var author = new BloggerPostData.AuthorData
                             {
                                 Id = AuthorId,
                                 Image = authorImage,
                                 DisplayName = AuthorDisplayName,
                                 Url = AuthorUrl
                             };

            var post = new BloggerPostData
                           {
                               Author = author,
                               Content = PostContent,
                               Id = PostId,
                               Labels = PostTags.ToList(),
                               Published = PostPublishedAt,
                               Title = PostTitle,
                               Url = PostUrl,
                               Updated = BlogUpdatedAt
                           };

            yield return post;
        }