Ejemplo n.º 1
0
        public async Task ShouldNotCreateWithContentAsync()
        {
            var dto = new CreatePageWithContentInputDto
            {
                Title   = "test",
                Url     = _data.Page_1_Url,
                Content = "my-test-content"
            };

            await Should.ThrowAsync <Exception>(async() => await _pageAdminAppService.CreatePageWithContentAsync(dto));
        }
Ejemplo n.º 2
0
        public async Task ShouldCreateWithContentAsync()
        {
            var dto = new CreatePageWithContentInputDto
            {
                Title   = "test",
                Url     = "test-url",
                Content = "my-test-content"
            };

            await Should.NotThrowAsync(async() => await _pageAdminAppService.CreatePageWithContentAsync(dto));

            var page = await _pageRepository.GetByUrlAsync(dto.Url);

            var content = await _contentRepository.GetAsync(nameof(Page), page.Id.ToString());

            content.Value.ShouldBe(dto.Content);
        }
Ejemplo n.º 3
0
 public virtual Task <PageDto> CreatePageWithContentAsync(CreatePageWithContentInputDto input)
 {
     return(PageAdminAppService.CreatePageWithContentAsync(input));
 }