|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Shouldly; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Xunit; |
|
|
|
@ -17,6 +18,38 @@ namespace Volo.CmsKit.Pages |
|
|
|
_pageRepository = GetRequiredService<IPageRepository>(); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task CountAsync() |
|
|
|
{ |
|
|
|
var totalCount = await _pageRepository.GetCountAsync(); |
|
|
|
|
|
|
|
totalCount.ShouldBe(2); |
|
|
|
|
|
|
|
var filteredCount = await _pageRepository.GetCountAsync(_cmsKitTestData.Page_2_Title); |
|
|
|
|
|
|
|
filteredCount.ShouldBe(1); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task GetListAsync() |
|
|
|
{ |
|
|
|
var list = await _pageRepository.GetListAsync(); |
|
|
|
|
|
|
|
list.ShouldNotBeNull(); |
|
|
|
list.Count.ShouldBe(2); |
|
|
|
|
|
|
|
var list_page_1 = await _pageRepository.GetListAsync(maxResultCount: 1); |
|
|
|
var list_page_2 = await _pageRepository.GetListAsync(maxResultCount: 1, skipCount: 1); |
|
|
|
|
|
|
|
list_page_1.ShouldNotBeNull(); |
|
|
|
list_page_1.Count.ShouldBe(1); |
|
|
|
list_page_1.First().Title.ShouldBe(_cmsKitTestData.Page_1_Title); |
|
|
|
|
|
|
|
list_page_2.ShouldNotBeNull(); |
|
|
|
list_page_1.Count.ShouldBe(1); |
|
|
|
list_page_2.First().Title.ShouldBe(_cmsKitTestData.Page_2_Title); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task ShouldGetByUrlAsync() |
|
|
|
{ |
|
|
|
|