Ejemplo n.º 1
0
        public void TestDisplayFooter()
        {
            BVConfiguration bvConfiguration = new BVSdkConfiguration();
            BVParameters bvParameters = new BVParameters();
            bvParameters.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);
            BVFooter bvFooter = new BVHTMLFooter(bvConfiguration, bvParameters);

            String displayFooter = bvFooter.displayFooter("getContent");
            Console.WriteLine(displayFooter);
            Assert.AreEqual<Boolean>(displayFooter.Contains("CLOUD"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("REVIEWS"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("PRODUCT"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=seo.sdk.execution.timeout>"), false, "the content string should not match.");
        }
Ejemplo n.º 2
0
        public void TestDisplayFooter_Debug()
        {
            BVConfiguration bvConfiguration = new BVSdkConfiguration();
            bvConfiguration.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "true");

            BVParameters bvParameters = new BVParameters();
            bvParameters.PageURI = "http://localhost:8080/Sample/Example-1.jsp?bvreveal=debug";
            bvParameters.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);

            BVSeoSdkUrl _bvSeoSdkUrl = new BVSeoSdkURLBuilder(bvConfiguration, bvParameters);
            BVFooter bvFooter = new BVHTMLFooter(bvConfiguration, bvParameters);
            bvFooter.setBvSeoSdkUrl(_bvSeoSdkUrl);

            String displayFooter = bvFooter.displayFooter("getContent");
            Console.WriteLine(displayFooter);
            Assert.AreEqual<Boolean>(displayFooter.Contains("LOCAL"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("REVIEWS"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("PRODUCT"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"loadSEOFilesLocally\">true</li>"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"productionS3Hostname\">seo.bazaarvoice.com</li>"), true, "seo.bazaarvoice.com should be present.");
        }
Ejemplo n.º 3
0
        public void TestDisplayFooter_URL_Debug_bvstate()
        {
            BVConfiguration bvConfiguration = new BVSdkConfiguration();
            bvConfiguration.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "false");

            BVParameters bvParameters = new BVParameters();
            bvParameters.PageURI = "http://localhost:8080/Sample/Example-1.jsp?bvstate=ct:r/id:id2/reveal:debug";
            bvParameters.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);
            bvParameters.ContentType = new BVContentType(BVContentType.REVIEWS);
            bvParameters.SubjectId = "id1";

            BVSeoSdkUrl _bvSeoSdkUrl = new BVSeoSdkURLBuilder(bvConfiguration, bvParameters);
            BVFooter bvFooter = new BVHTMLFooter(bvConfiguration, bvParameters);
            bvFooter.setBvSeoSdkUrl(_bvSeoSdkUrl);

            String displayFooter = bvFooter.displayFooter("getContent");
            Assert.AreEqual<Boolean>(displayFooter.Contains("CLOUD"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("REVIEWS"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("PRODUCT"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"contentURL\">http://seo.bazaarvoice.com"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"subjectId\">id2"), true, "the subjectId should match.");

            /** When loading from files it should not display URL. **/
            bvConfiguration = new BVSdkConfiguration();
            bvConfiguration.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "true");

            bvParameters = new BVParameters();
            bvParameters.PageURI = "http://localhost:8080/Sample/Example-1.jsp?bvstate=ct:r/id:id2/reveal:debug";
            bvParameters.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);
            bvParameters.ContentType = new BVContentType(BVContentType.REVIEWS);
            bvParameters.SubjectId = "id1";

            _bvSeoSdkUrl = new BVSeoSdkURLBuilder(bvConfiguration, bvParameters);
            bvFooter = new BVHTMLFooter(bvConfiguration, bvParameters);
            bvFooter.setBvSeoSdkUrl(_bvSeoSdkUrl);
            String contentUri = _bvSeoSdkUrl.seoContentUri().ToString();

            displayFooter = bvFooter.displayFooter("getContent");
            Console.WriteLine(displayFooter);
            Assert.AreEqual<Boolean>(displayFooter.Contains("LOCAL"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("REVIEWS"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("PRODUCT"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"contentURL\">http://seo.bazaarvoice.com"), false, "there should not be any url pattern.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"subjectId\">id2"), true, "the subjectId should match.");
        }
Ejemplo n.º 4
0
        public void TestDisplayFooter_Debug_Seller()
        {
            BVConfiguration bvConfiguration = new BVSdkConfiguration();

            BVParameters bvParameters = new BVParameters();
            bvParameters.PageURI = "http://localhost:8080/Sample/Example-1.jsp?bvreveal=debug";
            bvParameters.SubjectType = new BVSubjectType(BVSubjectType.SELLER);
            bvParameters.SubjectId = "seller";

            BVSeoSdkUrl _bvSeoSdkUrl = new BVSeoSdkURLBuilder(bvConfiguration, bvParameters);
            BVFooter bvFooter = new BVHTMLFooter(bvConfiguration, bvParameters);
            bvFooter.setBvSeoSdkUrl(_bvSeoSdkUrl);

            String displayFooter = bvFooter.displayFooter("getContent");
            Console.WriteLine(displayFooter);
            Assert.AreEqual<Boolean>(displayFooter.Contains("CLOUD"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("REVIEWS"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("SELLER"), true, "the content string should match.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"productionS3Hostname\">seo.bazaarvoice.com</li>"), false, "seo.bazaarvoice.com should not be present.");
            Assert.AreEqual<Boolean>(displayFooter.Contains("<li data-bvseo=\"stagingS3Hostname\">seo-stg.bazaarvoice.com</li>"), false, "seo-stg.bazaarvoice.com should not be present.");
        }