Beispiel #1
0
        private void AddTypedArticleSingleStartDateRangeParam(DnaTestURLRequestParams postParams, string startDate, int timeInterval)
        {
            postParams.Add("startdate", startDate);

            if (timeInterval > 0)
            {
                postParams.Add("timeinterval", timeInterval.ToString());
            }
        }
Beispiel #2
0
 private void AddTypedArticleUpdateParams(DnaTestURLRequestParams postParams, int entryId, string title, bool cancelled)
 {
     AddTypedArticleBaseParams(postParams, title);
     if (cancelled)
     {
         postParams.Add("aupdatecancelled", "1");
     }
     else
     {
         postParams.Add("aupdate", "1");
     }
     postParams.Add("h2g2id", GenerateH2G2Id(entryId).ToString());
 }
Beispiel #3
0
        private void AddTypedArticleSingleStartDateRangeParam(DnaTestURLRequestParams postParams, int startDay, int startMonth, int startYear, int timeInterval)
        {
            postParams.Add("startday", startDay.ToString());
            postParams.Add("startmonth", startMonth.ToString());
            postParams.Add("startyear", startYear.ToString());

            if (timeInterval > 0)
            {
                postParams.Add("timeinterval", timeInterval.ToString());
            }
        }
Beispiel #4
0
 private void AddTypedArticleCreateParams(DnaTestURLRequestParams postParams, string title, bool cancelled)
 {
     AddTypedArticleBaseParams(postParams, title);
     if (cancelled)
     {
         postParams.Add("acreatecancelled", "1");
     }
     else
     {
         postParams.Add("acreate", "1");
     }
 }
Beispiel #5
0
 private void AddTypedArticleBaseParams(DnaTestURLRequestParams postParams, string title)
 {
     postParams.Add("_msxml", "<MULTI-INPUT>" +
                             "    <REQUIRED NAME='TYPE'><VALIDATE TYPE='EMPTY'/></REQUIRED>" +
                             "    <REQUIRED NAME='BODY'><VALIDATE TYPE='EMPTY'/></REQUIRED>" +
                             "    <REQUIRED NAME='TITLE'><VALIDATE TYPE='EMPTY'/></REQUIRED>" +
                             "    <ELEMENT NAME='ROLE'></ELEMENT>" +
                             "    <REQUIRED NAME='WHOCANEDIT'><VALIDATE TYPE='EMPTY'/></REQUIRED>" +
                             "    <ELEMENT NAME='POLLTYPE1'></ELEMENT>" +
                             "    <ELEMENT NAME='POLLTYPE2'></ELEMENT>" +
                             "</MULTI-INPUT>");
     postParams.Add("type", "2");
     postParams.Add("_msfinish", "yes");
     postParams.Add("_msstage", "1");
     postParams.Add("title", title);
     postParams.Add("role", "testrole");
     postParams.Add("body", "Test body text");
     postParams.Add("whocanedit", "me");
 }
Beispiel #6
0
 private XmlDocument UpdateTypedArticleWithDateRange(DnaTestURLRequest request, int entryId, string startDate, string endDate, int timeInterval)
 {
     DnaTestURLRequestParams postParams = new DnaTestURLRequestParams();
     AddTypedArticleUpdateParams(postParams, entryId, CreateRandomTitle(), false);
     AddTypedArticleDateRangeParams(postParams, startDate, endDate, timeInterval);
     request.RequestPage("TypedArticle?skin=purexml", postParams.PostParams);
     return request.GetLastResponseAsXML();
 }
Beispiel #7
0
        private XmlDocument CreateTypedArticleWithSingleStartDateRange(DnaTestURLRequest request, int startDay, int startMonth, int startYear, int timeInterval)
        {
            DnaTestURLRequestParams postParams = new DnaTestURLRequestParams();
            AddTypedArticleCreateParams(postParams, CreateRandomTitle(), false);
            AddTypedArticleSingleStartDateRangeParam(postParams, startDay, startMonth, startYear, timeInterval);

            request.RequestPage("TypedArticle?skin=purexml", postParams.PostParams);
            return request.GetLastResponseAsXML();
        }
Beispiel #8
0
 private XmlDocument UpdateCancelledTypedArticle(DnaTestURLRequest request, int entryId)
 {
     DnaTestURLRequestParams postParams = new DnaTestURLRequestParams();
     AddTypedArticleUpdateParams(postParams, entryId, CreateRandomTitle(), true);
     request.RequestPage("TypedArticle?skin=purexml", postParams.PostParams);
     return request.GetLastResponseAsXML();
 }