From 2ead53d9f794a952075234e4c6a7da10b71b326d Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Tue, 19 Sep 2023 11:13:14 +0300 Subject: [PATCH] Add tests for PagePublicAppService.DoesSlugExistAsync --- .../Pages/PagePublicAppService_Tests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 index 0eeb3210a9..299ec64213 100644 --- 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 @@ -33,4 +33,20 @@ public class PagePublicAppService_Tests : CmsKitApplicationTestBase page.ShouldBeNull(); } + + [Fact] + public async Task DoesSlugExistAsync_ShouldReturnTrue_WhenExist() + { + var result = await _pageAppService.DoesSlugExistAsync(_data.Page_1_Slug); + + result.ShouldBeTrue(); + } + + [Fact] + public async Task DoesSlugExistAsync_ShouldReturnFalse_WhenExist() + { + var result = await _pageAppService.DoesSlugExistAsync("not-exist-url"); + + result.ShouldBeFalse(); + } }