From 6b3240136ebea4ebf7faa7663eaa3d103d809280 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 4 Oct 2024 10:07:38 +0800 Subject: [PATCH] Fix `cms-kit` unit tests. --- .../Comments/CommentPublicAppService_Tests.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs index e260e3debe..adf650c2ba 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs @@ -64,7 +64,7 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase .ShouldBeTrue(); }); } - + [Theory] [InlineData("https://abp.io/features")] public async Task CreateAsync_ShouldCreateComment_If_Url_Allowed(string text) @@ -84,8 +84,8 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase } [Theory] - [InlineData("[ABP Community](https://abp.io/community/)")] - [InlineData("abp.io/docs")] + [InlineData("[ABP Community](https://community.abp.io/)")] + [InlineData("docs.abp.io")] public async Task CreateAsync_ShouldThrowUserFriendlyException_If_Url_UnAllowed(string text) { _currentUser.Id.Returns(_cmsKitTestData.User2Id); @@ -94,7 +94,7 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase await _commentAppService.CreateAsync( _cmsKitTestData.EntityType1, _cmsKitTestData.EntityId1, - new CreateCommentInput + new CreateCommentInput { RepliedCommentId = null, Text = text, //not allowed URL @@ -104,7 +104,7 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase } [Fact] - public async Task CreateAsync_ShouldThrowUserFriendlyException_If_IdempotencyToken_Not_Unique() + public async Task CreateAsync_ShouldThrowUserFriendlyException_If_IdempotencyToken_Not_Unique() { _currentUser.Id.Returns(_cmsKitTestData.User2Id); @@ -112,10 +112,10 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase await _commentAppService.CreateAsync( _cmsKitTestData.EntityType1, _cmsKitTestData.EntityId1, - new CreateCommentInput + new CreateCommentInput { RepliedCommentId = null, - Text = "", + Text = "", IdempotencyToken = _cmsKitTestData.IdempotencyToken_1 } )); @@ -139,7 +139,7 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase comment.Text.ShouldBe("I'm Updated"); }); } - + [Fact] public async Task UpdateAsync_ShouldThrowUserFriendlyException_If_Url_UnAllowed() { @@ -148,9 +148,9 @@ public class CommentPublicAppService_Tests : CmsKitApplicationTestBase await Should.ThrowAsync(async () => await _commentAppService.UpdateAsync( _cmsKitTestData.CommentWithChildId, - new UpdateCommentInput + new UpdateCommentInput { - Text = "[ABP Community - Update](https://abp.io/community/)", //not allowed URL + Text = "[ABP Community - Update](https://community.abp.io/)", //not allowed URL } )); }