Пример #1
0
        public void Should_Not_Get_Comment_By_Id_If_It_Not_Found()
        {
            // Arrange
            var comment = new Domain.Comment
            {
                CommentId   = 1,
                CommentText = "CommentText"
            };

            _comments.Add(comment);

            // Act & Assert
            Assert.ThrowsAsync <EntityNotFoundException>(
                () => _commentProvider.GetComment(100500));
        }
Пример #2
0
        public void Should_Not_Delete_Comment_If_It_Not_Found()
        {
            // Arrange
            var comment = new Domain.Comment
            {
                CommentId   = 1,
                CommentText = "CommentText"
            };

            _comments.Add(comment);

            // Act & Assert
            Assert.ThrowsAsync <EntityNotFoundException>(
                () => _commentProvider.DeleteComment(100500));

            Assert.IsNotEmpty(_comments);
        }
Пример #3
0
        public async Task Should_Delete_Comment()
        {
            // Arrange
            var comment = new Domain.Comment
            {
                CommentId   = 1,
                CommentText = "CommentText"
            };

            _comments.Add(comment);

            // Act
            await _commentProvider.DeleteComment(comment.CommentId);

            // Assert
            Assert.IsEmpty(_comments);
        }