public async Task CreateAsync()
        {
            _currentUser.Id.Returns(_cmsKitTestData.User1Id);

            await _reactionPublicAppService.CreateAsync(
                _cmsKitTestData.EntityType2,
                _cmsKitTestData.EntityId2,
                StandardReactions.Eyes
                );

            UsingDbContext(context =>
            {
                var reaction = context.Set <UserReaction>().Where(x =>
                                                                  x.CreatorId == _cmsKitTestData.User1Id &&
                                                                  x.ReactionName == StandardReactions.Eyes &&
                                                                  x.EntityId == _cmsKitTestData.EntityId2 &&
                                                                  x.EntityType == _cmsKitTestData.EntityType2).ToList();

                reaction.Count.ShouldBe(1);
            });
        }
예제 #2
0
        public async Task CreateAsync()
        {
            _currentUser.Id.Returns(_cmsKitTestData.User1Id);

            await _reactionPublicAppService.CreateAsync(
                _cmsKitTestData.EntityType2,
                _cmsKitTestData.EntityId2,
                StandardReactions.Eyes
                );

            UsingDbContext(context =>
            {
                var reaction = context.Set <UserReaction>().FirstOrDefault(x =>
                                                                           x.CreatorId == _cmsKitTestData.User1Id &&
                                                                           x.ReactionName == StandardReactions.Eyes &&
                                                                           x.EntityId == _cmsKitTestData.EntityId2 &&
                                                                           x.EntityType == _cmsKitTestData.EntityType2);

                reaction.ShouldNotBeNull();
            });
        }