Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
929 B

using System;
using System.Threading.Tasks;
using Shouldly;
using Volo.CmsKit.Public.Pages;
using Xunit;
namespace Volo.CmsKit.Pages
{
public class PagePublicAppService_Tests : CmsKitApplicationTestBase
{
private readonly CmsKitTestData _data;
private readonly IPageAppService _pageAppService;
public PagePublicAppService_Tests()
{
_data = GetRequiredService<CmsKitTestData>();
_pageAppService = GetRequiredService<IPageAppService>();
}
[Fact]
public async Task ShouldGetByUrlAsync()
{
await Should.NotThrowAsync(async () => await _pageAppService.GetByUrlAsync(_data.Page_1_Url));
}
[Fact]
public async Task ShouldNotGetByUrlAsync()
{
await Should.ThrowAsync<Exception>(async () => await _pageAppService.GetByUrlAsync("not-exist-url"));
}
}
}