diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs index f7187fce04..59fcc8c8bd 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs @@ -16,11 +16,8 @@ namespace Volo.CmsKit.Pages private readonly IPageRepository _pageRepository; private readonly IContentRepository _contentRepository; - private readonly IUnitOfWorkManager _uowManager; - public PageAdminAppService_Tests() { - _uowManager = GetRequiredService(); _data = GetRequiredService(); _pageAdminAppService = GetRequiredService(); _pageRepository = GetRequiredService(); diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs new file mode 100644 index 0000000000..290f02caff --- /dev/null +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PagePublicAppService_Tests.cs @@ -0,0 +1,32 @@ +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(); + _pageAppService = GetRequiredService(); + } + + [Fact] + public async Task ShouldGetByUrlAsync() + { + await Should.NotThrowAsync(async () => await _pageAppService.GetByUrlAsync(_data.Page_1_Url)); + } + + [Fact] + public async Task ShouldNotGetByUrlAsync() + { + await Should.ThrowAsync(async () => await _pageAppService.GetByUrlAsync("not-exist-url")); + } + } +} \ No newline at end of file