コード例 #1
0
        public async Task CreateAsync_ShouldWorkProperly_WithCorrectData()
        {
            var title            = "My awesome new Post";
            var slug             = "my-awesome-new-post";
            var shortDescription = "This blog is all about awesomeness 🤗!";
            var content          = "Another blog post shared on internet";

            var created = await blogPostAdminAppService.CreateAsync(new CreateBlogPostDto
            {
                BlogId           = cmsKitTestData.Blog_Id,
                Title            = title,
                Slug             = slug,
                ShortDescription = shortDescription,
                Content          = content
            });

            created.Id.ShouldNotBe(Guid.Empty);

            var blogPost = await blogPostRepository.GetAsync(created.Id);

            blogPost.Title.ShouldBe(title);
            blogPost.Slug.ShouldBe(slug);
            blogPost.ShortDescription.ShouldBe(shortDescription);
            blogPost.Content.ShouldBe(content);
        }
コード例 #2
0
 public virtual Task <BlogPostDto> CreateAsync(CreateBlogPostDto input)
 {
     return(BlogPostAdminAppService.CreateAsync(input));
 }