public async Task DeleteAsync_ShouldWork() { await BlogAdminAppService.DeleteAsync(CmsKitTestData.Blog_Id); await Should.ThrowAsync <EntityNotFoundException>( async() => await BlogAdminAppService.GetAsync(CmsKitTestData.Blog_Id) ); }
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"); }
public async Task OnGetAsync() { var blog = await BlogAdminAppService.GetAsync(Id); ViewModel = ObjectMapper.Map <BlogDto, UpdateBlogViewModel>(blog); }
public async Task GetAsync() { var blog = await BlogAdminAppService.GetAsync(CmsKitTestData.Blog_Id); blog.Slug.ShouldBe(CmsKitTestData.BlogSlug); }