本文整理匯總了C#中Tests.DnaTestURLRequest.RequestPageWithParamList方法的典型用法代碼示例。如果您正苦於以下問題:C# DnaTestURLRequest.RequestPageWithParamList方法的具體用法?C# DnaTestURLRequest.RequestPageWithParamList怎麽用?C# DnaTestURLRequest.RequestPageWithParamList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tests.DnaTestURLRequest
的用法示例。
在下文中一共展示了DnaTestURLRequest.RequestPageWithParamList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ArchiveFailedTweets_TweetArchived
public void ArchiveFailedTweets_TweetArchived()
{
ClearModerationQueues();
var paramList = new DnaTestURLRequest.ParamList();
// Post three tweets, and collect the param list for the ModeratePost call later
// It checked that only failed tweets get archived to the "Deleted" tables
// This one will fail moderation
PostTweet(CreateTestTweet(64645735745376, "I, Partridge", "76767676", "Alan Partridge", "Ahah!"), ModerationStatus.ForumStatus.PreMod);
AddLatestPreModPostingToParamList(paramList, ModerationItemStatus.Failed, BBC.Dna.Api.PostStyle.Style.tweet);
// This one will pass moderation
PostTweet(CreateTestTweet(64645735745377, "chat suicide", "76767676", "Alan Partridge", "Ahah!"), ModerationStatus.ForumStatus.PreMod);
AddLatestPreModPostingToParamList(paramList, ModerationItemStatus.Passed, BBC.Dna.Api.PostStyle.Style.tweet);
// This one will fail moderation, but the post style is not a tweet
PostTweet(CreateTestTweet(64645735745378, "dormant volcano", "76767676", "Alan Partridge", "Ahah!"), ModerationStatus.ForumStatus.PreMod);
AddLatestPreModPostingToParamList(paramList, ModerationItemStatus.Failed, BBC.Dna.Api.PostStyle.Style.plaintext);
// Moderate these posts
var request = new DnaTestURLRequest(_sitename);
request.SetCurrentUserEditor();
request.RequestPageWithParamList("ModeratePosts", paramList);
using (IDnaDataReader reader = _context.CreateDnaDataReader(""))
{
reader.ExecuteDEBUGONLY(@"
select *
from PreModPostingsDeleted pmpd
join PreModPostingsTweetInfoDeleted pmptid on pmptid.modid=pmpd.modid
join ThreadModDeleted tmd on tmd.modid = pmptid.modid
where pmpd.reason='A' and pmptid.reason='A' and tmd.reason='A'");
Assert.IsTrue(reader.Read());
Assert.AreEqual(64645735745376, reader.GetInt64("tweetid"));
Assert.AreEqual("I, Partridge", reader.GetString("body"));
Assert.IsFalse(reader.Read(), "Only expecting one row of archived deleted posts");
// Check the last two posts are the other two moderated posts
reader.ExecuteDEBUGONLY(@"
select top 2 *
from ThreadEntries te
join ThreadEntriesTweetInfo teti on teti.ThreadEntryId=te.EntryId
order by te.entryid desc");
Assert.IsTrue(reader.Read());
Assert.AreEqual(64645735745378, reader.GetInt64("tweetid"));
Assert.AreEqual("dormant volcano", reader.GetString("text"));
Assert.AreEqual(1, reader.GetInt32("Hidden"), "This post failed moderation so should be hidden");
Assert.IsTrue(reader.Read());
Assert.AreEqual(64645735745377, reader.GetInt64("tweetid"));
Assert.AreEqual("chat suicide", reader.GetString("text"));
Assert.IsFalse(reader.GetNullableInt32("Hidden").HasValue, "The hidden flag should be NULL, i.e. not hidded");
}
}