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); }
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); }
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)); }