Ejemplo n.º 1
0
        public void CanHaveReply_CommentTreeLevelIsEqualToMaxCommentTreeLevel_ReturnsFalse()
        {
            // Arrange
            Comment comment = new Comment { TreeLevel = (byte)this._serviceSettings.MaxCommentTreeLevel };

            ICommentService target = new CommentService(new Mock<IUnitOfWork>().Object, this._commentValidationMock.Object,
            this._serviceSettings);

            // Act
            bool result = target.CanHaveReply(comment);

            // Assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 2
0
        public void CanHaveReply_CommentTreeLevelIsLessThanMaxCommentTreeLevel_ReturnsTrue()
        {
            // Arrange
            Comment comment = new Comment { TreeLevel = (byte)(this._serviceSettings.MaxCommentTreeLevel - 1) };

            // Arrange - create target
            ICommentService target = new CommentService(new Mock<IUnitOfWork>().Object, this._commentValidationMock.Object,
            this._serviceSettings);

            // Act
            bool result = target.CanHaveReply(comment);

            // Assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 3
0
        public void CanHaveReply_CommentIsNull_ThrowsArgumentNullException()
        {
            // Arrange
            ICommentService target = new CommentService(new Mock<IUnitOfWork>().Object, this._commentValidationMock.Object,
            this._serviceSettings);

            // Act and Assert
            Assert.Throws<ArgumentNullException>(() => target.CanHaveReply(null));
        }