示例#1
0
        public void MSVIEWSS_S03_TC09_UpdateView_LogicalJoinDefinitionPresent()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string listName = TestSuiteBase.ListGUID;
            string viewName = this.AddView(false, Query.EmptyQueryInfo, ViewType.Grid);

            // Call UpdateView method to update the query condition when LogicalJoinDefinition is present in the query and its child element is "Eq".
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForWhere(true);

            UpdateViewViewFields updateViewFields = new UpdateViewViewFields();

            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewAggregations aggregations = new UpdateViewAggregations();

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

            UpdateViewFormats formats = new UpdateViewFormats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewRowLimit updateRowLimit = new UpdateViewRowLimit();

            updateRowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewResponseUpdateViewResult updateViewResult = Adapter.UpdateView(
                listName,
                viewName,
                viewProperties,
                updateViewQuery,
                updateViewFields,
                aggregations,
                formats,
                updateRowLimit);

            this.Site.Assert.IsNotNull(updateViewResult, "The updated list view should be got successfully.");
            this.Site.Assert.IsNotNull(updateViewResult.View, "The server should return a View element that specifies the list view when the UpdateView 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.");
        }
示例#2
0
        public void MSVIEWSS_S03_TC10_UpdateView_LogicalJoinDefinitionWithoutChild()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string viewName = this.AddView(false, Query.AvailableQueryInfo, ViewType.Grid);
            string listName = TestSuiteBase.ListGUID;

            // Call UpdateView method to update the query condition when there are no child elements in LogicalJoinDefinition.
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForGroupBy(true);

            UpdateViewViewFields updateViewFields = new UpdateViewViewFields();

            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewAggregations aggregations = new UpdateViewAggregations();

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

            UpdateViewFormats formats = new UpdateViewFormats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewRowLimit updateRowLimit = new UpdateViewRowLimit();

            updateRowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewResponseUpdateViewResult updateViewResult = Adapter.UpdateView(
                listName,
                viewName,
                viewProperties,
                updateViewQuery,
                updateViewFields,
                aggregations,
                formats,
                updateRowLimit);

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

            // Call SUT control adapter method GetItemsCount to get the count of the list items in the specified view.
            int itemCountWithoutLogicalJoinDefinition       = SutControlAdapter.GetItemsCount(listName, viewName);
            int expectItemCountWithoutLogicalJoinDefinition = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // If there are no child elements in LogicalJoinDefinition, that is to say the query is empty query, then the number of view's items should be equal to the number of all items in the list, then MS-WSSCAML_R2501 can be captured.
            Site.CaptureRequirementIfAreEqual(
                expectItemCountWithoutLogicalJoinDefinition,
                itemCountWithoutLogicalJoinDefinition,
                "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.");
        }
示例#3
0
        public void MSVIEWSS_S03_TC11_UpdateView_FalseCollapse()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string viewName = this.AddView(false, Query.IsNotCollapse, ViewType.Grid);
            string listName = TestSuiteBase.ListGUID;

            // Call UpdateView method to update the list view to make it as default view.
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            viewProperties.View             = new UpdateViewPropertiesDefinition();
            viewProperties.View.DefaultView = "TRUE";

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForGroupBy(false);

            UpdateViewViewFields updateViewFields = new UpdateViewViewFields();

            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewAggregations aggregations = new UpdateViewAggregations();

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

            UpdateViewFormats formats = new UpdateViewFormats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewRowLimit updateRowLimit = new UpdateViewRowLimit();

            updateRowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewResponseUpdateViewResult updateViewResult = Adapter.UpdateView(
                listName,
                viewName,
                viewProperties,
                updateViewQuery,
                updateViewFields,
                aggregations,
                formats,
                updateRowLimit);

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

            // Call GetView method to get the list view updated above.
            GetViewResponseGetViewResult getViewAgain = Adapter.GetView(listName, viewName);

            this.Site.Assert.IsNotNull(getViewAgain, "The updated list view should be got successfully.");
            this.Site.Assert.IsNotNull(getViewAgain.View, "The response element \"getViewAgain.View\" should not be null.");
            this.Site.Assert.IsNotNull(getViewAgain.View.DefaultView, "The response element \"getViewAgain.View.DefaultView\" should not be null.");
            this.Site.Assert.AreEqual("true", getViewAgain.View.DefaultView.ToLower(), "The list view should be updated to default view!");

            // If the view is updated into a default view successfully, the original default view lost its default view position.
            if (TestSuiteBase.OriginalDefaultViewName != null)
            {
                if (TestSuiteBase.OriginalDefaultViewLost == false)
                {
                    TestSuiteBase.OriginalDefaultViewLost = true;
                }
            }

            // Call SUT control adapter method GetItemsCount to get the count of the list items in the specified view.
            int itemCollapseCount       = SutControlAdapter.GetItemsCount(listName, viewName);
            int expectItemCollapseCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // When the collapse attribute is false, even there are field values that can be grouped up, the number of view's items is the same as the number of all items in the list, then the following requirement can be captured.
            Site.CaptureRequirementIfAreEqual(
                expectItemCollapseCount,
                itemCollapseCount,
                "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.");
        }
示例#4
0
        public void MSVIEWSS_S03_TC08_UpdateView_TrueCollapse_NoComputedFields()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(1507, this.Site), @"The test case is executed only when R1507Enabled is set to true.");

            // Call AddView method to add a list view for the specified list on the server.
            string listName = TestSuiteBase.ListGUID;
            string viewName = this.AddView(false, Query.IsCollapse, ViewType.Grid);

            // Call UpdateView method to update the display name of the list view created above.
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            viewProperties.View             = new UpdateViewPropertiesDefinition();
            viewProperties.View.DisplayName = this.GenerateRandomString(10);

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForGroupBy(true);

            UpdateViewViewFields updateViewFields = new UpdateViewViewFields();

            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewAggregations aggregations = new UpdateViewAggregations();

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

            UpdateViewFormats formats = new UpdateViewFormats();

            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewRowLimit updateRowLimit = new UpdateViewRowLimit();

            updateRowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

            UpdateViewResponseUpdateViewResult updateViewResult = Adapter.UpdateView(
                listName,
                viewName,
                viewProperties,
                updateViewQuery,
                updateViewFields,
                aggregations,
                formats,
                updateRowLimit);

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

            // Call GetView method to get the list view updated above.
            GetViewResponseGetViewResult getView = Adapter.GetView(listName, viewName);

            this.Site.Assert.IsNotNull(getView, "The updated list view should be got successfully.");
            this.Site.Assert.IsNotNull(getView.View, "The response element \"getView.View\" should not be null.");
            this.Site.Assert.IsNotNull(getView.View.DisplayName, "The response element \"getView.View.DisplayName\" should not be null.");
            this.Site.Assert.AreEqual(viewProperties.View.DisplayName, getView.View.DisplayName, "The fields in the list view updated in the steps above should be got successfully!");

            // Call the SUT control adapter method GetItemsCount to get the count of the list items in the specified view.
            int itemCollapseCount       = SutControlAdapter.GetItemsCount(listName, viewName);
            int expectItemCollapseCount = int.Parse(Common.GetConfigurationPropertyValue("AllItemsCount", this.Site));

            // When the collapse attribute is true, if the number of view's items is the same as the number of all items in the list, then the following requirement can be captured.
            Site.CaptureRequirementIfAreEqual(
                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.)");
        }