public void Can_Process_Comment_When_Akistmet_Is_Enabled_And_Delete_Is_Enabled_Ham() { var comment = MockObjectFactory.CreateCommentRepository(); var settings = MockObjectFactory.CreateSettingsRepository(3); var akismet = MockObjectFactory.CreateAkismetService(); var error = MockObjectFactory.CreateErrorLogger(); var commentEntity = GetHamComment(1003, 7); var requestData = new RequestData(); var commentProcessorPipeline = new CommentProcessorPipeline(comment, settings, akismet, error, commentEntity, requestData); var akismetStatus = commentProcessorPipeline.ProcessComment(); Assert.IsFalse(akismetStatus.IsSpam); Assert.IsTrue(akismetStatus.IsHam); var commentsByPost = comment.GetCommentsByPostID(7); Assert.IsNotNull(commentsByPost.First()); Assert.AreEqual(commentEntity.CommentContent, commentsByPost.First().CommentContent); }
public void Can_Process_Comment_When_Akistmet_Is_Enabled_And_Delete_Is_Enabled_Spam() { var comment = MockObjectFactory.CreateCommentRepository(); var settings = MockObjectFactory.CreateSettingsRepository(3); var akismet = MockObjectFactory.CreateAkismetService(); var error = MockObjectFactory.CreateErrorLogger(); var commentEntity = GetSpamComment(1004, 8); var requestData = new RequestData(); var commentProcessorPipeline = new CommentProcessorPipeline(comment, settings, akismet, error, commentEntity, requestData); var akismetStatus = commentProcessorPipeline.ProcessComment(); Assert.IsTrue(akismetStatus.IsSpam); Assert.IsFalse(akismetStatus.IsHam); var commentsByPost = comment.GetAllComments(); var commentInQn = commentsByPost.SingleOrDefault(c => c.CommentID == 1004 && c.PostID == 8); Assert.IsNull(commentInQn); }