コード例 #1
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            //Do initial login
            WebTestRequest logonGet = AssertAndValidationHelper.GetLogonGetRequest();

            yield return(logonGet);

            WebTestRequest logonPostRequest = AssertAndValidationHelper.GetLogonPostRequest(this);
            var            loggedOnUserNameValidationRule = AssertAndValidationHelper.GetValidationRuleForHtmlTagInnerText(HtmlTextWriterTag.A.ToString(), HtmlTextWriterAttribute.Href.ToString(), "/account", "NugetTestAccount");

            logonPostRequest.ValidateResponse += loggedOnUserNameValidationRule.Validate;

            yield return(logonPostRequest);
        }
コード例 #2
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            var statsPageRequest = new WebTestRequest(UrlHelper.StatsPageUrl);

            // Checks for the presence of a link to jquery package. It is harded to Jquery for now as there is no API exposed for stats
            // and also Jquery is going to be one of the top 10 for now.
            var jQueryPackageValidationRule = AssertAndValidationHelper.GetValidationRuleForHtmlTagInnerText(HtmlTextWriterTag.A.ToString(), HtmlTextWriterAttribute.Href.ToString(), "/packages/EntityFramework/", "EntityFramework");

            statsPageRequest.ValidateResponse += jQueryPackageValidationRule.Validate;

            // Validation rule to check for the default text in stats page.
            var statsPageDefaultTextValidationRule = AssertAndValidationHelper.GetValidationRuleForFindText(Constants.StatsPageDefaultText);

            statsPageRequest.ValidateResponse += statsPageDefaultTextValidationRule.Validate;

            yield return(statsPageRequest);
        }