本文整理汇总了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();
}