Browse Source
Add tests for FindTitleAsync to IPageRepository
pull/18782/head
Enis Necipoglu
2 years ago
No known key found for this signature in database
GPG Key ID: 1EC55E13241E1680
1 changed files with
18 additions and
1 deletions
-
modules/cms-kit/test/Volo.CmsKit.TestBase/Pages/PageRepository_Test.cs
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.Linq; |
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Shouldly; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
@ -99,4 +100,20 @@ public abstract class PageRepository_Test<TStartupModule> : CmsKitTestBase<TStar |
|
|
|
|
|
|
|
pages.ShouldBeEmpty(); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task ShouldFindTitleAsync() |
|
|
|
{ |
|
|
|
var result = await _pageRepository.FindTitleAsync(_cmsKitTestData.Page_1_Id); |
|
|
|
result.ShouldNotBeNull(); |
|
|
|
result.ShouldBe(_cmsKitTestData.Page_1_Title); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task ShouldReturnNullFindTitleAsync() |
|
|
|
{ |
|
|
|
var nonExistingId = Guid.NewGuid(); |
|
|
|
var result = await _pageRepository.FindTitleAsync(nonExistingId); |
|
|
|
result.ShouldBeNull(); |
|
|
|
} |
|
|
|
} |
|
|
|
|