本文整理匯總了C#中Tests.DnaTestURLRequest.SetCurrentUserPreModUser方法的典型用法代碼示例。如果您正苦於以下問題:C# DnaTestURLRequest.SetCurrentUserPreModUser方法的具體用法?C# DnaTestURLRequest.SetCurrentUserPreModUser怎麽用?C# DnaTestURLRequest.SetCurrentUserPreModUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tests.DnaTestURLRequest
的用法示例。
在下文中一共展示了DnaTestURLRequest.SetCurrentUserPreModUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReadAs_PreModUser
public void ReadAs_PreModUser()
{
XmlDocument xml;
DnaXmlValidator myValidator;
DnaTestURLRequest myRequest = new DnaTestURLRequest(testUtils_ratingsAPI.sitename);
string forumId = testUtils_ratingsAPI.makeTestForum();
string ratingId = testUtils_ratingsAPI.makeTestItem(forumId);
string url = makeReadPickUrl(forumId);
markComment(ratingId);
myRequest.SetCurrentUserPreModUser();
try
{
myRequest.RequestPageWithFullURL(url);
}
catch { }
Assert.IsTrue(myRequest.CurrentWebResponse.StatusCode == HttpStatusCode.OK,
"Failed listing editor's picks. Got: " + myRequest.CurrentWebResponse.StatusCode + "\n" + myRequest.CurrentWebResponse.StatusDescription
);
xml = myRequest.GetLastResponseAsXML();
myValidator = new DnaXmlValidator(xml.InnerXml, testUtils_ratingsAPI._schemaRatingForum);
myValidator.Validate();
}
示例2: GetCallingUserInfo_AsPreModUser_ReturnsNormalUser
public void GetCallingUserInfo_AsPreModUser_ReturnsNormalUser()
{
Console.WriteLine("Before GetCallingUserInfo_AsPreModUser_ReturnsNormalUser");
DnaTestURLRequest request = new DnaTestURLRequest("h2g2");
request.SetCurrentUserPreModUser();
request.RequestPageWithFullURL(callinguserfull_secure_url);
BBC.Dna.Users.User user = (BBC.Dna.Users.User)StringUtils.DeserializeObject(request.GetLastResponseAsXML().OuterXml, typeof(BBC.Dna.Users.User));
Assert.AreEqual("Normal", user.StatusAsString);
Console.WriteLine("After GetCallingUserInfo_AsPreModUser_ReturnsNormalUser");
}
示例3: ReadAs_PreModUser
public void ReadAs_PreModUser()
{
XmlDocument xml;
DnaXmlValidator myValidator;
DnaTestURLRequest myRequest = new DnaTestURLRequest(testUtils_CommentsAPI.sitename);
string forumId = testUtils_CommentsAPI.makeTestCommentForum();
string commentID = testUtils_CommentsAPI.makeTestComment(forumId);
markComment(commentID);
myRequest.SetCurrentUserPreModUser();
// now read it
string url = String.Format(
"http://{0}/dna/api/comments/CommentsService.svc/V1/site/{1}/commentsforums/{2}/?filterBy=EditorPicks",
testUtils_CommentsAPI.server, testUtils_CommentsAPI.sitename, forumId
);
try
{
myRequest.RequestPageWithFullURL(url);
}
catch { }
Assert.IsTrue(myRequest.CurrentWebResponse.StatusCode == HttpStatusCode.OK,
"Failed listing editor's picks. Got: " + myRequest.CurrentWebResponse.StatusCode + "\n" + myRequest.CurrentWebResponse.StatusDescription
);
xml = myRequest.GetLastResponseAsXML();
myValidator = new DnaXmlValidator(xml.InnerXml, testUtils_CommentsAPI._schemaCommentForum);
myValidator.Validate();
}