コード例 #1
0
ファイル: FeedbackTests.cs プロジェクト: rsaladrigas/Subtext
        public void ApproveCommentRemovesDeletedAndConfirmedSpamBits()
        {
            Entry entry = SetupBlogForCommentsAndCreateEntry();
            var repository = new DatabaseObjectProvider();
            FeedbackItem comment = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                          FeedbackStatusFlag.ConfirmedSpam |
                                                                          FeedbackStatusFlag.Deleted);
            Assert.IsFalse(comment.Approved, "should not be approved");
            Assert.IsTrue(comment.Deleted, "should be deleted");
            Assert.IsTrue(comment.ConfirmedSpam, "should be confirmed spam");

            repository.Approve(comment, null);
            comment = repository.Get(comment.Id);
            Assert.IsTrue(comment.Approved, "Should be approved now.");
            Assert.IsFalse(comment.Deleted, "Should not be deleted.");
            Assert.IsFalse(comment.ConfirmedSpam, "Should not be confirmed spam.");
        }