コード例 #1
0
        public void MSVIEWSS_S04_TC12_CompareUpdateViewHtmlResult()
        {
            // Call AddView method to add a list view for the specified list on the server.           
            string viewName = this.AddView(true, Query.AvailableQueryInfo, ViewType.Html);
            string listName = TestSuiteBase.ListGUID;

            // Call UpdateViewHtml method to update the display name of the view added above.
            UpdateViewHtmlViewProperties viewProperties = new UpdateViewHtmlViewProperties();
            viewProperties.View = new UpdateViewPropertiesDefinition();
            viewProperties.View.DisplayName = this.GenerateRandomString(10);
            UpdateViewHtmlToolbar toolbar;
            UpdateViewHtmlViewHeader viewHeader;
            UpdateViewHtmlViewBody viewBody;
            UpdateViewHtmlViewFooter viewFooter;
            UpdateViewHtmlViewEmpty viewEmpty;
            UpdateViewHtmlRowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtmlQuery queryValue = new UpdateViewHtmlQuery();
            queryValue.Query = this.GetCamlQueryRootForWhere(false);

            UpdateViewHtmlViewFields updateViewFields = new UpdateViewHtmlViewFields();
            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtmlAggregations aggregations = new UpdateViewHtmlAggregations();
            this.GetAggregationsDefinition(true, true, Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site));

            UpdateViewHtmlFormats formats = new UpdateViewHtmlFormats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtmlRowLimit rowLimitValue = new UpdateViewHtmlRowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewHtmlResponseUpdateViewHtmlResult updateViewHtmlResult = Adapter.UpdateViewHtml(
                                                                                       listName,
                                                                                       viewName,
                                                                                       viewProperties,
                                                                                       toolbar,
                                                                                       viewHeader,
                                                                                       viewBody,
                                                                                       viewFooter,
                                                                                       viewEmpty,
                                                                                       rowLimitExceeded,
                                                                                       queryValue,
                                                                                       updateViewFields,
                                                                                       aggregations,
                                                                                       formats,
                                                                                       rowLimitValue);
            this.Site.Assert.IsNotNull(updateViewHtmlResult, "The updated view html should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtmlResult.View, "The server should return a View element that specifies the list view when the UpdateViewHtml method succeeds!");

            // Call UpdateViewHtml2 method to update the display name of the view when openApplicationExtension is set to null and all other parameters are same as above UpdateViewHtml method.
            UpdateViewHtml2ViewProperties viewProperties2 = new UpdateViewHtml2ViewProperties();
            viewProperties2.View = new UpdateViewPropertiesDefinition();
            viewProperties2.View.DisplayName = viewProperties.View.DisplayName;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue2 = new UpdateViewHtml2Query();
            queryValue.Query = this.GetCamlQueryRootForWhere(false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations2 = new UpdateViewHtml2Aggregations();
            this.GetAggregationsDefinition(true, true, Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site));

            UpdateViewHtml2Formats formats2 = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue2 = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Result = Adapter.UpdateViewHtml2(
                                                                                       listName,
                                                                                       viewName,
                                                                                       viewProperties2,
                                                                                       null,
                                                                                       null,
                                                                                       null,
                                                                                       null,
                                                                                       null,
                                                                                       null,
                                                                                       queryValue2,
                                                                                       viewFields,
                                                                                       aggregations2,
                                                                                       formats2,
                                                                                       rowLimitValue2,
                                                                                       null);

            this.Site.Assert.IsNotNull(updateViewHtml2Result, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Result.View, "The server should return a View element that specifies the list view when the UpdateViewHtml method succeeds!");

            // Compare the two responses returned by UpdateViewHtml and UpdateViewHtml2.
            bool isSame = this.DoCompare(updateViewHtmlResult.View, updateViewHtml2Result.View);
            
            // If the two responses are equal, then capture this requirement.
            Site.CaptureRequirementIfIsTrue(
                isSame,
                12501,
                @"[In UpdateViewHtml] When processing this call[[UpdateViewHtml]], the protocol server MUST return the same results as for the UpdateViewHtml2 method (section 3.1.4.8) with parameter openApplicationExtension as empty.");
        }
        public void MSVIEWSS_S05_TC05_UpdateViewHtml2_EmptyViewName()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            string listName = TestSuiteBase.ListGUID;

            // Add a default view.
            this.AddView(true, Query.EmptyQueryInfo, ViewType.Grid);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar toolbar;
            UpdateViewHtml2ViewHeader viewHeader;
            UpdateViewHtml2ViewBody viewBody;
            UpdateViewHtml2ViewFooter viewFooter;
            UpdateViewHtml2ViewEmpty viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();
            queryValue.Query = this.GetCamlQueryRoot(Query.IsNotCollapse, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);
            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 operation with empty view name.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                                                                       listName,
                                                                                       string.Empty,
                                                                                       viewProperties,
                                                                                       toolbar,
                                                                                       viewHeader,
                                                                                       viewBody,
                                                                                       viewFooter,
                                                                                       viewEmpty,
                                                                                       rowLimitExceeded,
                                                                                       queryValue,
                                                                                       viewFields,
                                                                                       aggregations,
                                                                                       formats,
                                                                                       rowLimitValue,
                                                                                       openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View.DefaultView, "The response element \"updateViewHtml2Re.View.DefaultView\" should not be null.");
            bool isDefaultView = Convert.ToBoolean(updateViewHtml2Re.View.DefaultView);

            // Verify Requirement MS-VIEWSS_R2302, if the server returns the default view back.
            Site.CaptureRequirementIfIsTrue(isDefaultView, 2302, @"[In viewName] When the value of viewName element is empty, the protocol server MUST refer to the default list view of the list.");
        }
        public void MSVIEWSS_S05_TC09_UpdateViewHtml2_NoDefaultView()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            string listName = TestSuiteBase.ListGUID;

            // Add a default view.
            string viewName = AddView(true, Query.EmptyQueryInfo, ViewType.Grid);

            // Delete the default view.
            this.DeleteView(viewName);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar toolbar;
            UpdateViewHtml2ViewHeader viewHeader;
            UpdateViewHtml2ViewBody viewBody;
            UpdateViewHtml2ViewFooter viewFooter;
            UpdateViewHtml2ViewEmpty viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();
            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);
            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            bool caughtSoapException = false; 

            try
            {
                // Call UpdateViewHtml2 operation with an empty view name, expecting to update the default view.
                Adapter.UpdateViewHtml2(
                    listName,
                    string.Empty,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    queryValue,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimitValue,
                    openApplicationExtension);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true; 

                // Verify Requirement MS-VIEWSS_R24, if the server returns a SOAP fault message.
                Site.CaptureRequirementIfIsNotNull(soapException, 24, @"[In viewName] If the default list view does not exist, the protocol server MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response."); 

            caughtSoapException = false;

            try
            {
                // Call UpdateViewHtml2 operation with view name not present, expecting to update the default view.
                Adapter.UpdateViewHtml2(
                    listName,
                    null,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    queryValue,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimitValue,
                    openApplicationExtension);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true; 

                // Verify Requirement MS-VIEWSS_R24, if the server returns a SOAP fault message.
                Site.CaptureRequirementIfIsNotNull(soapException, 24, @"[In viewName] If the default list view does not exist, the protocol server MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response."); 
        }
        public void MSVIEWSS_S05_TC03_UpdateViewHtml2_GroupByAndCollapse()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(1507, this.Site), @"The test case is executed only when R1507Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Grid);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.RecursiveAll);
            UpdateViewHtml2Toolbar toolbar;
            UpdateViewHtml2ViewHeader viewHeader;
            UpdateViewHtml2ViewBody viewBody;
            UpdateViewHtml2ViewFooter viewFooter;
            UpdateViewHtml2ViewEmpty viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            // Make the query have GroupBy condition and Collapse as false.
            queryValue.Query = this.GetCamlQueryRoot(Query.IsNotCollapse, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);
            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view with a query having GroupBy condition and Collapse as false.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                                                                       TestSuiteBase.ListGUID,
                                                                                       viewName,
                                                                                       viewProperties,
                                                                                       toolbar,
                                                                                       viewHeader,
                                                                                       viewBody,
                                                                                       viewFooter,
                                                                                       viewEmpty,
                                                                                       rowLimitExceeded,
                                                                                       queryValue,
                                                                                       viewFields,
                                                                                       aggregations,
                                                                                       formats,
                                                                                       rowLimitValue,
                                                                                       openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            int itemGroupByCount = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);

            int expectAllItemsCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R67, if the item count in the view returned from the server is the same with the count of all list items.
            Site.CaptureRequirementIfAreEqual(expectAllItemsCount, itemGroupByCount, "MS-WSSCAML", 67, @"[In Attributes] Otherwise[In GroupByDefinition: If Collapse is false], the number of rows in the result set MUST NOT be affected by the GroupBy element.");

            // Make the query have GroupBy condition and Collapse as true, while the referenced view fields have no computed fields.
            queryValue.Query = this.GetCamlQueryRoot(Query.IsCollapse, false);

            // Call UpdateViewHtml2 to update the view with a query having GroupBy condition and Collapse as true, while the referenced view fields have no computed fields.
            updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                                        TestSuiteBase.ListGUID,
                                                        viewName,
                                                        viewProperties,
                                                        toolbar,
                                                        viewHeader,
                                                        viewBody,
                                                        viewFooter,
                                                        viewEmpty,
                                                        rowLimitExceeded,
                                                        queryValue,
                                                        viewFields,
                                                        aggregations,
                                                        formats,
                                                        rowLimitValue,
                                                        openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            int itemCollapseCount = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);
            int expectItemCollapseCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-VIEWSS_R1507, if the item count in the view returned from the server is the same with the count of all items in the list.
            Site.CaptureRequirementIfAreEqual<int>(expectItemCollapseCount, itemCollapseCount, 1507, @"[In Appendix B: Product Behavior] Implementation does not restrict the number of rows present in the result set to the number of unique tuples where a tuple is a set of field values when there aren't any computed fields in the ViewFields section if Collapse is true.(Windows SharePoint Services 2.0 and above products follow this behavior.)");
        }
        public void MSVIEWSS_S05_TC01_UpdateViewHtml2_Success()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Html);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar toolbar;
            UpdateViewHtml2ViewHeader viewHeader;
            UpdateViewHtml2ViewBody viewBody;
            UpdateViewHtml2ViewFooter viewFooter;
            UpdateViewHtml2ViewEmpty viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,  
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();
            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);
            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view including display properties and the possibility to be rendered with extended application.
            // All optional parameters in the request of UpdateViewHtml2 are present in this call.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                                                                       TestSuiteBase.ListGUID,
                                                                                       viewName,
                                                                                       viewProperties,
                                                                                       toolbar,
                                                                                       viewHeader,
                                                                                       viewBody,
                                                                                       viewFooter,
                                                                                       viewEmpty,
                                                                                       rowLimitExceeded,
                                                                                       queryValue,
                                                                                       viewFields,
                                                                                       aggregations,
                                                                                       formats,
                                                                                       rowLimitValue,
                                                                                       openApplicationExtension);

            this.Site.Assert.IsNotNull(updateViewHtml2Re, "There should be a result element returned from the UpdateViewHtml2 operation.");

            // Verify Requirement MS-VIEWSS_R145, if the server returns a View element in the update result.
            Site.CaptureRequirementIfIsNotNull(updateViewHtml2Re.View, 145, @"[In UpdateViewHtml2Response] UpdateViewHtml2Result: If the protocol server successfully updates the list view, it MUST return a View element that specifies the list view.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View.DisplayName, "The response element \"updateViewHtml2Re.View.DisplayName\" should not be null.");
            this.Site.Assert.AreEqual(viewProperties.View.DisplayName, updateViewHtml2Re.View.DisplayName, "The display name should be the same as updated.");

            // Verify Requirement MS-VIEWSS_R8016, if the server returns a View element in the update result that indicates the UpdateViewHTML2 operation succeed on the server.
            Site.CaptureRequirementIfIsNotNull(updateViewHtml2Re.View, 8016, @"[In Appendix B: Product Behavior] Implementation does support this method[UpdateViewHtml2]. (Windows SharePoint Services 3.0 and above products follow this behavior.)");
            // Verify requirement: MS-VIEWSS_R8015
            if (Common.IsRequirementEnabled(8015, this.Site))
            {
                string listName = TestSuiteBase.ListGUID;
                string displayName = this.GenerateRandomString(5);
                string type = ViewType.Html.ToString();
                AddViewViewFields viewFields1 = new AddViewViewFields();
                viewFields.ViewFields = this.GetViewFields(true);
                AddViewQuery addViewQuery = new AddViewQuery();
                addViewQuery.Query = this.GetCamlQueryRootForWhere(false);
                AddViewRowLimit rowLimit = new AddViewRowLimit();
                rowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

                AddViewResponseAddViewResult addViewResponseAddViewResult = Adapter.AddView(listName, displayName, viewFields1, addViewQuery, rowLimit, type, false);

                UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re2 = Adapter.UpdateViewHtml2(
                                                                                          listName,
                                                                                          viewName,
                                                                                          viewProperties,
                                                                                          toolbar,
                                                                                          viewHeader,
                                                                                          viewBody,
                                                                                          viewFooter,
                                                                                          viewEmpty,
                                                                                          rowLimitExceeded,
                                                                                          queryValue,
                                                                                          viewFields,
                                                                                          aggregations,
                                                                                          formats,
                                                                                          rowLimitValue,
                                                                                          openApplicationExtension);
                GetViewResponseGetViewResult getView = Adapter.GetView(listName, viewName);
                Site.CaptureRequirementIfAreEqual(
                   openApplicationExtension,
                    getView.View.Text[0],
                    8015,
                    @"[In Appendix B: Product Behavior] Implementation does return the value of OpenApplicationExtension as the value of the View element when GetView is called after UpdateViewHtml2 (section 3.1.4.8) and the type of the view is HTML. <3> Section 3.1.4.3.2.2: In SharePoint Foundation 2010 and SharePoint Foundation 2013, when this method is called after UpdateViewHtml2 (section 3.1.4.8) and the type of the view is HTML, the value of OpenApplicationExtension is returned as the value of the View element. (SharePoint Server 2010 and above follow this hebavior.)");
            }
        }
コード例 #6
0
        public void MSVIEWSS_S05_TC09_UpdateViewHtml2_NoDefaultView()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            string listName = TestSuiteBase.ListGUID;

            // Add a default view.
            string viewName = AddView(true, Query.EmptyQueryInfo, ViewType.Grid);

            // Delete the default view.
            this.DeleteView(viewName);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            bool caughtSoapException = false;

            try
            {
                // Call UpdateViewHtml2 operation with an empty view name, expecting to update the default view.
                Adapter.UpdateViewHtml2(
                    listName,
                    string.Empty,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    queryValue,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimitValue,
                    openApplicationExtension);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // Verify Requirement MS-VIEWSS_R24, if the server returns a SOAP fault message.
                Site.CaptureRequirementIfIsNotNull(soapException, 24, @"[In viewName] If the default list view does not exist, the protocol server MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response.");

            caughtSoapException = false;

            try
            {
                // Call UpdateViewHtml2 operation with view name not present, expecting to update the default view.
                Adapter.UpdateViewHtml2(
                    listName,
                    null,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    queryValue,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimitValue,
                    openApplicationExtension);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // Verify Requirement MS-VIEWSS_R24, if the server returns a SOAP fault message.
                Site.CaptureRequirementIfIsNotNull(soapException, 24, @"[In viewName] If the default list view does not exist, the protocol server MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response.");
        }
        public void MSVIEWSS_S05_TC02_UpdateViewHtml2_LogicalJoin()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Html);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Item);
            UpdateViewHtml2Toolbar toolbar;
            UpdateViewHtml2ViewHeader viewHeader;
            UpdateViewHtml2ViewBody viewBody;
            UpdateViewHtml2ViewFooter viewFooter;
            UpdateViewHtml2ViewEmpty viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            // Make the query having LogicalJoinDefinition element with available child in it.
            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();
            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);
            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view with available LogicalJoinDefinition query condition.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                                                                       TestSuiteBase.ListGUID,
                                                                                       viewName,
                                                                                       viewProperties,
                                                                                       toolbar,
                                                                                       viewHeader,
                                                                                       viewBody,
                                                                                       viewFooter,
                                                                                       viewEmpty,
                                                                                       rowLimitExceeded,
                                                                                       queryValue,
                                                                                       viewFields,
                                                                                       aggregations,
                                                                                       formats,
                                                                                       rowLimitValue,
                                                                                       openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            int itemCountInTheView = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);

            int expectIQueryItemsCount = int.Parse(Common.GetConfigurationPropertyValue("QueryItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R25, if the item count in the view returned from the server is the same with the query expectation.
            Site.CaptureRequirementIfAreEqual(expectIQueryItemsCount, itemCountInTheView, "MS-WSSCAML", 25, @"[In LogicalJoinDefinition Type] When this element[LogicalJoinDefinition] is present and has child elements, the server MUST return only list items that satisfy the conditions specified by those child elements.");

            // Make the query having no child element in LogicalJoinDefinition, an empty query.
            queryValue.Query = this.GetCamlQueryRoot(Query.EmptyQueryInfo, false);

            // Call UpdateViewHtml2 to update the view with an empty query condition.
            updateViewHtml2Re = Adapter.UpdateViewHtml2(
                                          TestSuiteBase.ListGUID,
                                          viewName,
                                          viewProperties,
                                          toolbar,
                                          viewHeader,
                                          viewBody,
                                          viewFooter,
                                          viewEmpty,
                                          rowLimitExceeded,
                                          queryValue,
                                          viewFields,
                                          aggregations,
                                          formats,
                                          rowLimitValue,
                                          openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            itemCountInTheView = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);
            int expectAllItemsCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R2501, if the item count in the view returned from the server is the same with the count of all list items.
            Site.CaptureRequirementIfAreEqual(expectAllItemsCount, itemCountInTheView, "MS-WSSCAML", 2501, @"[In LogicalJoinDefinition Type] When there are no child elements[in the element of LogicalJoinDefinition type], no additional conditions apply to the query.");
        }
コード例 #8
0
        public void MSVIEWSS_S05_TC05_UpdateViewHtml2_EmptyViewName()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            string listName = TestSuiteBase.ListGUID;

            // Add a default view.
            this.AddView(true, Query.EmptyQueryInfo, ViewType.Grid);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            queryValue.Query = this.GetCamlQueryRoot(Query.IsNotCollapse, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 operation with empty view name.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                listName,
                string.Empty,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);

            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View.DefaultView, "The response element \"updateViewHtml2Re.View.DefaultView\" should not be null.");
            bool isDefaultView = Convert.ToBoolean(updateViewHtml2Re.View.DefaultView);

            // Verify Requirement MS-VIEWSS_R2302, if the server returns the default view back.
            Site.CaptureRequirementIfIsTrue(isDefaultView, 2302, @"[In viewName] When the value of viewName element is empty, the protocol server MUST refer to the default list view of the list (1).");
        }
コード例 #9
0
        public void MSVIEWSS_S05_TC07_UpdateViewHtml2_InvalidListName()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.AvailableQueryInfo, ViewType.Html);

            string listName = this.GenerateRandomString(8);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            bool caughtSoapException = false;

            try
            {
                // Call UpdateViewHtml2 operation with invalid list name.
                Adapter.UpdateViewHtml2(
                    listName,
                    viewName,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    queryValue,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimitValue,
                    openApplicationExtension);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // Verify Requirement MS-VIEWSS_R13, if the server returns a SOAP fault message.
                Site.CaptureRequirementIfIsNotNull(soapException, 13, @"[In listName] If the value of listName element is not the name or GUID of a list (1), the operation MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response.");
        }
コード例 #10
0
        public void MSVIEWSS_S05_TC01_UpdateViewHtml2_Success()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Html);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Recursive);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view including display properties and the possibility to be rendered with extended application.
            // All optional parameters in the request of UpdateViewHtml2 are present in this call.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                TestSuiteBase.ListGUID,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);

            this.Site.Assert.IsNotNull(updateViewHtml2Re, "There should be a result element returned from the UpdateViewHtml2 operation.");

            // Verify Requirement MS-VIEWSS_R145, if the server returns a View element in the update result.
            Site.CaptureRequirementIfIsNotNull(updateViewHtml2Re.View, 145, @"[In UpdateViewHtml2Response] UpdateViewHtml2Result: If the protocol server successfully updates the list view, it MUST return a View element that specifies the list view.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View.DisplayName, "The response element \"updateViewHtml2Re.View.DisplayName\" should not be null.");
            this.Site.Assert.AreEqual(viewProperties.View.DisplayName, updateViewHtml2Re.View.DisplayName, "The display name should be the same as updated.");

            // Verify Requirement MS-VIEWSS_R8016, if the server returns a View element in the update result that indicates the UpdateViewHTML2 operation succeed on the server.
            Site.CaptureRequirementIfIsNotNull(updateViewHtml2Re.View, 8016, @"[In Appendix B: Product Behavior] Implementation does support this method[UpdateViewHtml2]. (Windows SharePoint Services 3.0 and above products follow this behavior.)");
        }
コード例 #11
0
        public void MSVIEWSS_S05_TC03_UpdateViewHtml2_GroupByAndCollapse()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(1507, this.Site), @"The test case is executed only when R1507Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Grid);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.RecursiveAll);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            // Make the query have GroupBy condition and Collapse as false.
            queryValue.Query = this.GetCamlQueryRoot(Query.IsNotCollapse, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view with a query having GroupBy condition and Collapse as false.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                TestSuiteBase.ListGUID,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);

            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            int itemGroupByCount = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);

            int expectAllItemsCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R67, if the item count in the view returned from the server is the same with the count of all list items.
            Site.CaptureRequirementIfAreEqual(expectAllItemsCount, itemGroupByCount, "MS-WSSCAML", 67, @"[In Attributes] Otherwise[In GroupByDefinition: If Collapse is false], the number of rows in the result set MUST NOT be affected by the GroupBy element.");

            // Make the query have GroupBy condition and Collapse as true, while the referenced view fields have no computed fields.
            queryValue.Query = this.GetCamlQueryRoot(Query.IsCollapse, false);

            // Call UpdateViewHtml2 to update the view with a query having GroupBy condition and Collapse as true, while the referenced view fields have no computed fields.
            updateViewHtml2Re = Adapter.UpdateViewHtml2(
                TestSuiteBase.ListGUID,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            int itemCollapseCount       = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);
            int expectItemCollapseCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-VIEWSS_R1507, if the item count in the view returned from the server is the same with the count of all items in the list.
            Site.CaptureRequirementIfAreEqual <int>(expectItemCollapseCount, itemCollapseCount, 1507, @"[In Appendix B: Product Behavior] Implementation does not restrict the number of rows present in the result set to the number of unique tuples where a tuple is a set of field values when there aren't any computed fields in the ViewFields section if Collapse is true.(Windows SharePoint Services 2.0 and above products follow this behavior.)");
        }
コード例 #12
0
        public void MSVIEWSS_S05_TC02_UpdateViewHtml2_LogicalJoin()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(8016, this.Site), @"The test case is executed only when R8016Enabled is set to true.");

            // Add a view.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Html);

            string updatedDisplayName = this.GenerateRandomString(6);
            UpdateViewHtml2ViewProperties   viewProperties = this.GetViewProperties(false, updatedDisplayName, false, ViewScope.Item);
            UpdateViewHtml2Toolbar          toolbar;
            UpdateViewHtml2ViewHeader       viewHeader;
            UpdateViewHtml2ViewBody         viewBody;
            UpdateViewHtml2ViewFooter       viewFooter;
            UpdateViewHtml2ViewEmpty        viewEmpty;
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                out toolbar,
                out viewHeader,
                out viewBody,
                out viewFooter,
                out viewEmpty,
                out rowLimitExceeded);

            UpdateViewHtml2Query queryValue = new UpdateViewHtml2Query();

            // Make the query having LogicalJoinDefinition element with available child in it.
            queryValue.Query = this.GetCamlQueryRoot(Query.AvailableQueryInfo, false);

            UpdateViewHtml2ViewFields viewFields = new UpdateViewHtml2ViewFields();

            viewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtml2Aggregations aggregations = new UpdateViewHtml2Aggregations();
            string aggregationsType = Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site);

            aggregations.Aggregations = this.GetAggregationsDefinition(true, true, aggregationsType);

            UpdateViewHtml2Formats formats = new UpdateViewHtml2Formats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtml2RowLimit rowLimitValue = new UpdateViewHtml2RowLimit();

            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            string openApplicationExtension = Common.GetConfigurationPropertyValue("OpenApplicationExtension", this.Site);

            // Call UpdateViewHtml2 to update the view with available LogicalJoinDefinition query condition.
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Re = Adapter.UpdateViewHtml2(
                TestSuiteBase.ListGUID,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);

            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            int itemCountInTheView = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);

            int expectIQueryItemsCount = int.Parse(Common.GetConfigurationPropertyValue("QueryItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R25, if the item count in the view returned from the server is the same with the query expectation.
            Site.CaptureRequirementIfAreEqual(expectIQueryItemsCount, itemCountInTheView, "MS-WSSCAML", 25, @"[In LogicalJoinDefinition Type] When this element[LogicalJoinDefinition] is present and has child elements, the server MUST return only list items that satisfy the conditions specified by those child elements.");

            // Make the query having no child element in LogicalJoinDefinition, an empty query.
            queryValue.Query = this.GetCamlQueryRoot(Query.EmptyQueryInfo, false);

            // Call UpdateViewHtml2 to update the view with an empty query condition.
            updateViewHtml2Re = Adapter.UpdateViewHtml2(
                TestSuiteBase.ListGUID,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                queryValue,
                viewFields,
                aggregations,
                formats,
                rowLimitValue,
                openApplicationExtension);
            this.Site.Assert.IsNotNull(updateViewHtml2Re, "The updated view html2 should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewHtml2Re.View, "There should be a view element returned from a successful UpdateViewHtml2 operation.");

            // Get the count of the items in the view.
            itemCountInTheView = TestSuiteBase.SutControlAdapter.GetItemsCount(TestSuiteBase.ListGUID, viewName);
            int expectAllItemsCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // Verify Requirement MS-WSSCAML_R2501, if the item count in the view returned from the server is the same with the count of all list items.
            Site.CaptureRequirementIfAreEqual(expectAllItemsCount, itemCountInTheView, "MS-WSSCAML", 2501, @"[In LogicalJoinDefinition Type] When there are no child elements[in the element of LogicalJoinDefinition type], no additional conditions apply to the query.");
        }
コード例 #13
0
        /// <summary>
        /// This operation is used to obtain details of a specified list view of the specified list, including display properties in CAML and HTML.
        /// </summary>
        /// <param name="listName">Specify a list on the server.</param>
        /// <param name="viewName">Specify a list view on the server.</param>
        /// <param name="viewProperties">Specify the properties of a list view on the server.</param>
        /// <param name="toolbar">Specify the rendering of the toolbar of a list.</param>
        /// <param name="viewHeader">Specify the rendering of the header, or the top of a list view page.</param>
        /// <param name="viewBody">Specify the rendering of the main, or the middle portion of a list view page.</param>
        /// <param name="viewFooter">Specify the rendering of the footer, or the bottom of a list view page.</param>
        /// <param name="viewEmpty">Specify the message to be displayed when no items are in a list view.</param>
        /// <param name="rowLimitExceeded">Specify rendering of additional items when the number of items exceeds the value.</param>
        /// <param name="query">Include the information that affects how a list view displays the data.</param>
        /// <param name="viewFields">Specify the fields included in a list view.</param>
        /// <param name="aggregations">The type of the aggregation.</param>
        /// <param name="formats">Specify the row and column formatting of a list view.</param>
        /// <param name="rowLimit">Specify whether a list supports displaying items page-by-page, and the count of items a list view displays per page.</param>
        /// <param name="openApplicationExtension">Specify what kind of application to use to edit the view.</param>
        /// <returns>The result returns a View that the type is ViewDefinition if the operation succeeds</returns>
        public UpdateViewHtml2ResponseUpdateViewHtml2Result UpdateViewHtml2(
            string listName,
            string viewName,
            UpdateViewHtml2ViewProperties viewProperties,
            UpdateViewHtml2Toolbar toolbar,
            UpdateViewHtml2ViewHeader viewHeader,
            UpdateViewHtml2ViewBody viewBody,
            UpdateViewHtml2ViewFooter viewFooter,
            UpdateViewHtml2ViewEmpty viewEmpty,
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded,
            UpdateViewHtml2Query query,
            UpdateViewHtml2ViewFields viewFields,
            UpdateViewHtml2Aggregations aggregations,
            UpdateViewHtml2Formats formats,
            UpdateViewHtml2RowLimit rowLimit,
            string openApplicationExtension)
        {
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Result;

            try
            {
                updateViewHtml2Result = this.viewssProxy.UpdateViewHtml2(
                    listName,
                    viewName,
                    viewProperties,
                    toolbar,
                    viewHeader,
                    viewBody,
                    viewFooter,
                    viewEmpty,
                    rowLimitExceeded,
                    query,
                    viewFields,
                    aggregations,
                    formats,
                    rowLimit,
                    openApplicationExtension);

                // Used to validate the transport requirements.
                this.CaptureTransportRelatedRequirements();

                // Used to validate the UpdateViewHtml2 schema requirements.
                this.ValidateUpdateViewHtml2Result(updateViewHtml2Result);
            }
            catch (SoapException soapException)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    @"There is an exception generated when calling [UpdateViewHtml2] method:\r\n{0}",
                    soapException.Detail.InnerXml);

                // Used to validate the transport requirements.
                this.CaptureTransportRelatedRequirements();

                // Used to validate the schema of SoapFault.
                this.ValidateSOAPFaultDetails(soapException.Detail);

                throw;
            }

            return(updateViewHtml2Result);
        }
コード例 #14
0
        /// <summary>
        /// This operation is used to obtain details of a specified list view of the specified list, including display properties in CAML and HTML.
        /// </summary>
        /// <param name="listName">Specify a list on the server.</param>
        /// <param name="viewName">Specify a list view on the server.</param>
        /// <param name="viewProperties">Specify the properties of a list view on the server.</param>
        /// <param name="toolbar">Specify the rendering of the toolbar of a list.</param>
        /// <param name="viewHeader">Specify the rendering of the header, or the top of a list view page.</param>
        /// <param name="viewBody">Specify the rendering of the main, or the middle portion of a list view page.</param>
        /// <param name="viewFooter">Specify the rendering of the footer, or the bottom of a list view page.</param>
        /// <param name="viewEmpty">Specify the message to be displayed when no items are in a list view.</param>
        /// <param name="rowLimitExceeded">Specify rendering of additional items when the number of items exceeds the value.</param>
        /// <param name="query">Include the information that affects how a list view displays the data.</param>
        /// <param name="viewFields">Specify the fields included in a list view.</param>
        /// <param name="aggregations">The type of the aggregation.</param> 
        /// <param name="formats">Specify the row and column formatting of a list view.</param>
        /// <param name="rowLimit">Specify whether a list supports displaying items page-by-page, and the count of items a list view displays per page.</param>
        /// <param name="openApplicationExtension">Specify what kind of application to use to edit the view.</param>
        /// <returns>The result returns a View that the type is ViewDefinition if the operation succeeds</returns>
        public UpdateViewHtml2ResponseUpdateViewHtml2Result UpdateViewHtml2(
            string listName,
            string viewName,
            UpdateViewHtml2ViewProperties viewProperties,
            UpdateViewHtml2Toolbar toolbar,
            UpdateViewHtml2ViewHeader viewHeader,
            UpdateViewHtml2ViewBody viewBody,
            UpdateViewHtml2ViewFooter viewFooter,
            UpdateViewHtml2ViewEmpty viewEmpty,
            UpdateViewHtml2RowLimitExceeded rowLimitExceeded,
            UpdateViewHtml2Query query,
            UpdateViewHtml2ViewFields viewFields,
            UpdateViewHtml2Aggregations aggregations,
            UpdateViewHtml2Formats formats,
            UpdateViewHtml2RowLimit rowLimit,
            string openApplicationExtension)
        {
            UpdateViewHtml2ResponseUpdateViewHtml2Result updateViewHtml2Result;

            try
            {
                updateViewHtml2Result = this.viewssProxy.UpdateViewHtml2(
                listName,
                viewName,
                viewProperties,
                toolbar,
                viewHeader,
                viewBody,
                viewFooter,
                viewEmpty,
                rowLimitExceeded,
                query,
                viewFields,
                aggregations,
                formats,
                rowLimit,
                openApplicationExtension);

                // Used to validate the transport requirements.
                this.CaptureTransportRelatedRequirements();

                // Used to validate the UpdateViewHtml2 schema requirements.
                this.ValidateUpdateViewHtml2Result(updateViewHtml2Result);
            }
            catch (SoapException soapException)
            {
                this.Site.Log.Add(
                                LogEntryKind.Debug,
                                @"There is an exception generated when calling [UpdateViewHtml2] method:\r\n{0}",
                                soapException.Detail.InnerXml);

                // Used to validate the transport requirements.
                this.CaptureTransportRelatedRequirements();

                // Used to validate the schema of SoapFault.
                this.ValidateSOAPFaultDetails(soapException.Detail);

                throw;
            }

            return updateViewHtml2Result;
        }