Exemple #1
0
        public async void GetLikesByPostId_LikesCount_ReturnsZero(int nonExistantPostId)
        {
            // Arrange
            IList <Like> likes = new List <Like> {
                GenerateFake.Like(),
                         GenerateFake.Like(),
                         GenerateFake.Like()
            };

            _mockContext.Setup(x => x.Likes).ReturnsDbSet(likes);

            // Act
            var like = await _mockRepo.GetLikesByPostId(nonExistantPostId);

            // Assert
            Assert.Equal(0, like.Count());
        }