Beispiel #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            var dto = ObjectMapper.Map <UpdateBlogViewModel, UpdateBlogDto>(ViewModel);

            await BlogAdminAppService.UpdateAsync(Id, dto);

            return(NoContent());
        }
    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");
    }