Esempio n. 1
0
        public void TestEquality()
        {
            BVParameters bvParamObj1 = new BVParameters();

            bvParamObj1.UserAgent   = "googlebot";
            bvParamObj1.BaseURI     = "Example-Vector.jsp";
            bvParamObj1.PageURI     = "http://localhost/Example-Vector.jsp?someQuery=value1";
            bvParamObj1.ContentType = new BVContentType(BVContentType.REVIEWS);
            bvParamObj1.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);
            bvParamObj1.SubjectId   = "1501";

            BVParameters bvParamObj2 = null;

            Assert.AreEqual <Boolean>(bvParamObj1.Equals(bvParamObj2), false, "object1 and object2 should not be equal");

            bvParamObj2 = bvParamObj1;
            Assert.AreEqual <Boolean>(bvParamObj1.Equals(bvParamObj2), true, "object1 and object2 should be equal");

            /*
             * Other object instance test
             */
            Assert.AreEqual <Boolean>(bvParamObj1.Equals("ABCD"), false, "object1 and someother should not be equal");

            bvParamObj2             = new BVParameters();
            bvParamObj2.UserAgent   = "msnbot";
            bvParamObj2.BaseURI     = "Example-Vector.jsp";
            bvParamObj2.PageURI     = "http://localhost/Example-Vector.jsp?someQuery=value1";
            bvParamObj2.ContentType = new BVContentType(BVContentType.REVIEWS);
            bvParamObj2.SubjectType = new BVSubjectType(BVSubjectType.PRODUCT);
            bvParamObj2.SubjectId   = "1501";
            Assert.AreEqual <Boolean>(bvParamObj1.Equals(bvParamObj2), false, "object1 and object2 should not be equal");
        }
        private void postProcess(BVParameters bvParameters)
        {
            bvFooter = new BVHTMLFooter(_bvConfiguration, bvParameters);
            message  = new StringBuilder();

            /*
             * Validator to check if all the bvParameters are valid.
             */
            bvParamValidator = new BVDefaultValidator();
            validationError  = bvParamValidator.validate(_bvConfiguration, bvParameters);

            if (!String.IsNullOrEmpty(validationError))
            {
                return;
            }

            reloadContent = bvParameters.Equals(this.bvParameters);

            if (!reloadContent)
            {
                this.bvParameters = bvParameters;

                bvSeoSdkUrl = new BVSeoSdkURLBuilder(_bvConfiguration, bvParameters);

                bvUiContentService = new BVUIContentServiceProvider(_bvConfiguration);
                bvUiContentService.setBVParameters(this.bvParameters);
                bvUiContentService.setBVSeoSdkUrl(bvSeoSdkUrl);
            }
            bvFooter.setBvSeoSdkUrl(bvSeoSdkUrl);
        }