public void Test_Spotlights_QAProduction() { _bvConfiguration.addProperty(BVClientConfig.STAGING, "false"); _bvConfiguration.addProperty(BVClientConfig.TESTING, "true"); _bvUIContent = new BVManagedUIContent(_bvConfiguration); BVParameters bvParameters = new BVParameters(); bvParameters.UserAgent = "google"; bvParameters.ContentType = new BVContentType(BVContentType.SPOTLIGHTS); bvParameters.SubjectType = new BVSubjectType(BVSubjectType.CATEGORY); bvParameters.SubjectId = "category-3"; bvParameters.BaseURI = "http://www.example.com/store/products/reviews"; bvParameters.PageURI = "http://www.example.com/store/products/data-gen-696yl2lg1kurmqxn88fqif5y2/?utm_campaign=bazaarvoice&utm_medium=SearchVoice&utm_source=RatingsAndReviews&utm_content=Default&bvrrp=Main_Site-en_US/reviews/product/1/50524.htm"; bvParameters.PageNumber = "1"; String erroMessage = null; String content = null; try { stopwatch.Restart(); content = _bvUIContent.getContent(bvParameters); stopwatch.Stop(); } catch (BVSdkException e) { erroMessage = e.getMessage(); } Console.WriteLine(content); Assert.IsTrue(stopwatch.ElapsedMilliseconds <= CONTENT_RETRIEVAL_THRESHOLD, String.Format("Content retrieval time exceeded {0} milliseconds", CONTENT_RETRIEVAL_THRESHOLD)); Assert.IsTrue(!content.Contains("<li data-bvseo=\"ms\">bvseo-msg:")); Assert.IsTrue(content.Contains("<li data-bvseo=\"ct_st\">SPOTLIGHTS")); Assert.IsFalse(content.Contains("HTTP 403 Forbidden"), "There should be valid content"); }
public void BVManagedUIContent2_TestInitialize() { BVConfiguration _bvConfiguration = new BVSdkConfiguration(); _bvConfiguration.addProperty(BVClientConfig.BV_ROOT_FOLDER, DISPLAY_CODE); _bvConfiguration.addProperty(BVClientConfig.CLOUD_KEY, CLOUD_KEY); _bvConfiguration.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "false"); _bvConfiguration.addProperty(BVClientConfig.SEO_SDK_ENABLED, "true"); _bvConfiguration.addProperty(BVClientConfig.STAGING, "true"); _bvConfiguration.addProperty(BVClientConfig.EXECUTION_TIMEOUT, "300000"); _bvUIContent = new BVManagedUIContent(_bvConfiguration); }
public void BVManagedUIContent4_TestInitialize() { BVConfiguration _bvConfiguration = new BVSdkConfiguration(); _bvConfiguration.addProperty(BVClientConfig.BV_ROOT_FOLDER, DISPLAY_CODE); _bvConfiguration.addProperty(BVClientConfig.CLOUD_KEY, CLOUD_KEY); _bvConfiguration.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "false"); _bvConfiguration.addProperty(BVClientConfig.SEO_SDK_ENABLED, "true"); _bvConfiguration.addProperty(BVClientConfig.STAGING, "true"); _bvConfiguration.addProperty(BVClientConfig.EXECUTION_TIMEOUT, "300000"); _bvUIContent = new BVManagedUIContent(_bvConfiguration); }
public void Test_SellerRatings_Production() { _bvConfiguration.addProperty(BVClientConfig.STAGING, "false"); _bvConfiguration.addProperty(BVClientConfig.TESTING, "false"); _bvUIContent = new BVManagedUIContent(_bvConfiguration); BVParameters bvParameters = new BVParameters(); bvParameters.UserAgent = "google"; bvParameters.ContentType = new BVContentType(BVContentType.REVIEWS); bvParameters.SubjectType = new BVSubjectType(BVSubjectType.SELLER); bvParameters.SubjectId = "seller"; bvParameters.BaseURI = "http://www.example.com/store/products/reviews"; bvParameters.PageURI = "http://www.example.com/store/products/data-gen-696yl2lg1kurmqxn88fqif5y2/?utm_campaign=bazaarvoice&utm_medium=SearchVoice&utm_source=RatingsAndReviews&utm_content=Default&bvrrp=Main_Site-en_US/reviews/product/1/50524.htm"; bvParameters.PageNumber = "1"; String erroMessage = null; String content = null; try { stopwatch.Restart(); content = _bvUIContent.getContent(bvParameters); stopwatch.Stop(); } catch (BVSdkException e) { erroMessage = e.getMessage(); } Console.WriteLine(content); Assert.IsTrue(stopwatch.ElapsedMilliseconds <= CONTENT_RETRIEVAL_THRESHOLD, String.Format("Content retrieval time exceeded {0} milliseconds", CONTENT_RETRIEVAL_THRESHOLD)); Assert.IsTrue(!content.Contains("<li data-bvseo=\"ms\">bvseo-msg:")); Assert.IsTrue(content.Contains("<li data-bvseo=\"ct_st\">REVIEWS, SELLER")); Assert.IsFalse(content.Contains("HTTP 403 Forbidden"), "There should be valid content"); }