當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。