当前位置: 首页>>代码示例>>C#>>正文


C# DnaTestURLRequest.SetCurrentUserPreModUser方法代码示例

本文整理汇总了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();
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:29,代码来源:editorsPicksTests_v1.cs

示例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");
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:14,代码来源:users.cs

示例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();
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:32,代码来源:editorsPicksTests_v1.cs


注:本文中的Tests.DnaTestURLRequest.SetCurrentUserPreModUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。