Browse Source

Fix tests for the CMS Kit.

pull/5163/head
Halil İbrahim Kalkan 6 years ago
parent
commit
e4fcb11872
  1. 16
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs
  2. 22
      modules/cms-kit/test/Volo.CmsKit.Application.Tests/Reactions/ReactionPublicAppService_Tests.cs

16
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Comments/CommentPublicAppService_Tests.cs

@ -41,13 +41,15 @@ namespace Volo.CmsKit.Comments
{ {
_currentUser.Id.Returns(_cmsKitTestData.User2Id); _currentUser.Id.Returns(_cmsKitTestData.User2Id);
var newComment = await _commentAppService.CreateAsync(new CreateCommentInput var newComment = await _commentAppService.CreateAsync(
{ _cmsKitTestData.EntityType1,
EntityId = _cmsKitTestData.EntityId1, _cmsKitTestData.EntityId1,
EntityType = _cmsKitTestData.EntityType1, new CreateCommentInput
RepliedCommentId = null, {
Text = "newComment" RepliedCommentId = null,
}); Text = "newComment"
}
);
UsingDbContext(context => UsingDbContext(context =>
{ {

22
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Reactions/ReactionPublicAppService_Tests.cs

@ -57,12 +57,11 @@ namespace Volo.CmsKit.Reactions
{ {
_currentUser.Id.Returns(_cmsKitTestData.User1Id); _currentUser.Id.Returns(_cmsKitTestData.User1Id);
await _reactionPublicAppService.CreateAsync(new CreateReactionDto await _reactionPublicAppService.CreateAsync(
{ _cmsKitTestData.EntityType2,
EntityType = _cmsKitTestData.EntityType2, _cmsKitTestData.EntityId2,
EntityId = _cmsKitTestData.EntityId2, StandardReactions.Hooray
ReactionName = StandardReactions.Hooray );
});
UsingDbContext(context => UsingDbContext(context =>
{ {
@ -81,12 +80,11 @@ namespace Volo.CmsKit.Reactions
{ {
_currentUser.Id.Returns(_cmsKitTestData.User1Id); _currentUser.Id.Returns(_cmsKitTestData.User1Id);
await _reactionPublicAppService.DeleteAsync(new DeleteReactionDto await _reactionPublicAppService.DeleteAsync(
{ _cmsKitTestData.EntityType1,
EntityType = _cmsKitTestData.EntityType1, _cmsKitTestData.EntityId1,
EntityId = _cmsKitTestData.EntityId1, StandardReactions.Confused
ReactionName = StandardReactions.Confused );
});
UsingDbContext(context => UsingDbContext(context =>
{ {

Loading…
Cancel
Save