Beispiel #1
0
        public async Task Should_Get_All_Comments()
        {
            //Arrange
            _comments.AddRange(TestComments);

            //Act
            var commetns = await _commentProvider.GetAllComments();

            //Assert
            Assert.AreEqual(TestComments.Count, commetns.Count);
            CollectionAssert.AreEqual(
                TestComments.Select(x => x.CommentId),
                commetns.Select(x => x.CommentId));
        }
Beispiel #2
0
        public async Task Should_Get_Post_Comments()
        {
            //Arrange
            _comments.AddRange(TestComments);
            var postId = TestComments[0].PostId;

            //Act
            var commetns = await _commentProvider.GetPostComments(postId);

            //Assert
            CollectionAssert.AreEqual(
                TestComments
                .Where(x => x.PostId == postId)
                .Select(x => x.CommentId),
                commetns.Select(x => x.CommentId)
                );
        }
 public void Save()
 {
     TestComments.UpdateCurrentSet(comments);
 }
 internal TestCommentRepository()
 {
     comments = TestComments.CloneCurrentSet();
 }