Пример #1
0
    public async Task DeleteAsync_ShouldWork()
    {
        await BlogAdminAppService.DeleteAsync(CmsKitTestData.Blog_Id);

        await Should.ThrowAsync <EntityNotFoundException>(
            async() =>
            await BlogAdminAppService.GetAsync(CmsKitTestData.Blog_Id)
            );
    }
Пример #2
0
    public async Task UpdateAsync_ShouldWork()
    {
        var blog = await BlogAdminAppService.UpdateAsync(CmsKitTestData.Blog_Id, new UpdateBlogDto
        {
            Name = "New Name",
            Slug = "new-slug"
        });

        var updatedBlog = await BlogAdminAppService.GetAsync(CmsKitTestData.Blog_Id);

        updatedBlog.Name.ShouldBe("New Name");
        updatedBlog.Slug.ShouldBe("new-slug");
    }
Пример #3
0
        public async Task OnGetAsync()
        {
            var blog = await BlogAdminAppService.GetAsync(Id);

            ViewModel = ObjectMapper.Map <BlogDto, UpdateBlogViewModel>(blog);
        }
Пример #4
0
    public async Task GetAsync()
    {
        var blog = await BlogAdminAppService.GetAsync(CmsKitTestData.Blog_Id);

        blog.Slug.ShouldBe(CmsKitTestData.BlogSlug);
    }