Microsoft.Protocols.TestSuites.MS_VIEWSS.S04_MaintainViewProperties.MSVIEWSS_S04_TC15_UpdateViewHtml_LogicalJoinDefinitionPresent C# (CSharp) Method

MSVIEWSS_S04_TC15_UpdateViewHtml_LogicalJoinDefinitionPresent() private method

        public void MSVIEWSS_S04_TC15_UpdateViewHtml_LogicalJoinDefinitionPresent()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Html);
            string listName = TestSuiteBase.ListGUID;
         
            // Call UpdateViewHtml method to update the query condition when LogicalJoinDefinition is present in the query and its child element is "Eq".
            UpdateViewHtmlViewProperties viewProperties = new UpdateViewHtmlViewProperties();

            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(true);

            UpdateViewHtmlViewFields viewFields = new UpdateViewHtmlViewFields();
            viewFields.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,
                                                                                       viewFields,
                                                                                       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 SUT control adapter method GetItemsCount to get the count of the list items in the specified view. 
            int itemCountWithLogicalJoinDefinition = SutControlAdapter.GetItemsCount(listName, viewName);
            int expectItemCountWithLogicalJoinDefinition = int.Parse(Common.GetConfigurationPropertyValue("QueryItemsCount", this.Site));
           
            // If there is a query condition, the number of view's items should be equal to the number of items queried, then MS-WSSCAML_R25 can be captured.
            Site.CaptureRequirementIfAreEqual(
                expectItemCountWithLogicalJoinDefinition,
                itemCountWithLogicalJoinDefinition,
                "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.");
        }