GetPagedFeedback() public method

Gets the paged feedback.
public GetPagedFeedback ( int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type ) : IPagedCollection
pageIndex int Index of the page.
pageSize int Size of the page.
status FeedbackStatusFlag A flag for the status types to return.
excludeStatusMask FeedbackStatusFlag A flag for the statuses to exclude.
type FeedbackType The type of feedback to return.
return IPagedCollection
コード例 #1
0
ファイル: FeedbackTests.cs プロジェクト: rsaladrigas/Subtext
        public void CanGetAllApprovedComments()
        {
            Entry entry = SetupBlogForCommentsAndCreateEntry();
            var repository = new DatabaseObjectProvider();
            FeedbackItem commentOne = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                             FeedbackStatusFlag.Approved);
            FeedbackItem commentTwo = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                             FeedbackStatusFlag.ApprovedByModerator);
            FeedbackItem commentThree = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                               FeedbackStatusFlag.ConfirmedSpam);
            repository.ConfirmSpam(commentThree, null);
            FeedbackItem commentFour = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                              FeedbackStatusFlag.FalsePositive);

            //We expect three of the four.
            IPagedCollection<FeedbackItem> feedback = repository.GetPagedFeedback(0, 10,
                                                                                FeedbackStatusFlag.
                                                                                    Approved,
                                                                                FeedbackStatusFlag.None,
                                                                                FeedbackType.Comment);
            Assert.AreEqual(3, feedback.Count, "We expected three to match.");

            //Expect reverse order
            Assert.AreEqual(commentOne.Id, feedback[2].Id, "The first does not match");
            Assert.AreEqual(commentTwo.Id, feedback[1].Id, "The first does not match");
            Assert.AreEqual(commentFour.Id, feedback[0].Id, "The first does not match");
        }
コード例 #2
0
ファイル: FeedbackTests.cs プロジェクト: rsaladrigas/Subtext
        public void CanGetItemsFlaggedAsSpam()
        {
            Entry entry = SetupBlogForCommentsAndCreateEntry();
            var repository = new DatabaseObjectProvider();
            CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment, FeedbackStatusFlag.FalsePositive);
            CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment, FeedbackStatusFlag.Approved);
            CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment, FeedbackStatusFlag.ConfirmedSpam);
            FeedbackItem included = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                           FeedbackStatusFlag.FlaggedAsSpam);
            FeedbackItem includedToo = CreateAndUpdateFeedbackWithExactStatus(entry, FeedbackType.Comment,
                                                                              FeedbackStatusFlag.FlaggedAsSpam |
                                                                              FeedbackStatusFlag.NeedsModeration);

            //We expect 2 of the four.
            IPagedCollection<FeedbackItem> feedback = repository.GetPagedFeedback(0, 10,
                                                                                                 FeedbackStatusFlag.
                                                                                                     FlaggedAsSpam,
                                                                                                 FeedbackStatusFlag.
                                                                                                     Approved |
                                                                                                 FeedbackStatusFlag.
                                                                                                     Deleted,
                                                                                                 FeedbackType.Comment);
            Assert.AreEqual(2, feedback.Count, "We expected two to match.");

            //Expect reverse order
            Assert.AreEqual(included.Id, feedback[1].Id, "The first does not match");
            Assert.AreEqual(includedToo.Id, feedback[0].Id, "The second does not match");
        }