示例#1
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            // Use a predefined test package.
            var packageId          = Constants.TestPackageId;
            var packagePageRequest = new WebTestRequest(UrlHelper.BaseUrl + @"/Packages/" + packageId);

            // Rule to check if the title contains the package id and the latest stable version of the package.
            var packageTitleValidationRule = AssertAndValidationHelper.GetValidationRuleForFindText(packageId + " " + ClientSdkHelper.GetLatestStableVersion(packageId));

            packagePageRequest.ValidateResponse += packageTitleValidationRule.Validate;

            // Rule to check that the download count is present in the response.
            var downloadCountValidationRule = AssertAndValidationHelper.GetValidationRuleForFindText(ClientSdkHelper.GetFormattedDownLoadStatistics(packageId));

            packagePageRequest.ValidateResponse += downloadCountValidationRule.Validate;

            yield return(packagePageRequest);
        }