Example #1
0
        public void MSVIEWSS_S03_TC12_GetView_InvalidListName()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string viewName = this.AddView(false, Query.AvailableQueryInfo, ViewType.Grid);

            bool caughtSoapException = false;

            // Call GetView method with invalid listName to get the list view added above.
            try
            {
                GetViewResponseGetViewResult getView = Adapter.GetView(this.GenerateRandomString(5), viewName);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // If the server returns SOAP fault, then capture this requirement.
                Site.CaptureRequirementIfIsNotNull(
                    soapException,
                    13,
                    "[In listName] If the value of listName element is not the name or GUID of a list, the operation MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response.");
        }
Example #2
0
        public void MSVIEWSS_S03_TC07_UpdateView_AllParameters()
        {
            // 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.AvailableQueryInfo, ViewType.Grid);

            // Call UpdateView method to update the FPModified.
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            viewProperties.View            = new UpdateViewPropertiesDefinition();
            viewProperties.View.FPModified = "true";

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForWhere(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 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.FPModified, "The response element \"getView.View.FPModified\" should not be null.");
            this.Site.Assert.AreEqual("true", getView.View.FPModified.ToLower(), "The updated FPModified should be gotten successfully!");

            // If the protocol server updates the list view successfully, and returns a View element that specifies the list view, then the following requirement can be captured.
            Site.CaptureRequirement(
                121,
                @"[In UpdateViewResponse] UpdateViewResult: If the protocol server successfully updates the list view, it MUST return a View element that specifies the list view.");
        }
Example #3
0
        public void MSVIEWSS_S03_TC06_GetView_Success()
        {
            // 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.AvailableQueryInfo, ViewType.Grid);

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

            this.Site.Assert.IsNotNull(getView, "The list view got with valid parameter should be got successfully.");
            this.Site.Assert.IsNotNull(getView.View, "The protocol server should return a View element that contains the details of the specified list view!");
            this.Site.Assert.IsNotNull(getView.View.Name, "The response element \"getView.View.Name\" should not be null.");
            this.Site.Assert.AreEqual(viewName, getView.View.Name, "Server should return the list view created above!");

            // If server returns a View element that contains the details of the specified list view in the response, then below requirement can be captured.
            Site.CaptureRequirement(
                109,
                @"[In GetViewResponse] The protocol server MUST return a View element [in the GetViewResult element] that contains the details of the specified list view when the operation [GetView] succeeds.");
        }
Example #4
0
        public void MSVIEWSS_S03_TC04_GetView_EmptyViewName()
        {
            string listName = TestSuiteBase.ListGUID;

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

            // Call GetView method with an empty viewName.
            GetViewResponseGetViewResult getView = Adapter.GetView(listName, string.Empty);

            this.Site.Assert.IsNotNull(getView, "The list view got with an empty viewName parameter 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.DefaultView, "The response element \"getView.View.DefaultView\" should not be null.");

            // If server refers to the default list view of the list, then the below requirement can be captured.
            Site.CaptureRequirementIfAreEqual(
                "true",
                getView.View.DefaultView.ToLower(),
                2302,
                @"[In viewName] When the value of viewName element is empty, the protocol server MUST refer to the default list view of the list.");
        }
Example #5
0
        public void MSVIEWSS_S03_TC03_GetView_NullViewName()
        {
            // Call GetViewCollection to see if there is a default list view in the server.
            string listName = TestSuiteBase.ListGUID;

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

            // Call GetView method with a null viewName.
            GetViewResponseGetViewResult getView = Adapter.GetView(listName, null);

            this.Site.Assert.IsNotNull(getView, "The list view got with null viewName parameter 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.DefaultView, "The response element \"getView.View.DefaultView\" should not be null.");

            // If server refers to the default list view of the list, then the below requirement can be captured.
            Site.CaptureRequirementIfAreEqual(
                "true",
                getView.View.DefaultView.ToLower(),
                2301,
                @"[In viewName] When viewName element is not present in the message, the protocol server MUST refer to the default list view of the list (1).");
        }
Example #6
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.");
        }
Example #7
0
        public void MSVIEWSS_S03_TC01_UpdateView_InvalidListName()
        {
            // Call AddView method to add a list view for the specified list on the server.
            string viewName = this.AddView(false, Query.AvailableQueryInfo, ViewType.Grid);

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

            this.Site.Assert.IsNotNull(getView.View, "The list view added in the step above should be gotten successfully!");

            string invalidListName = this.GenerateRandomString(10);
            UpdateViewViewProperties viewProperties = new UpdateViewViewProperties();

            UpdateViewQuery updateViewQuery = new UpdateViewQuery();

            updateViewQuery.Query = this.GetCamlQueryRootForWhere(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();

            bool caughtSoapException = false;

            // Call UpdateView method to update the list view added above with an invalid listName.
            try
            {
                Adapter.UpdateView(
                    invalidListName,
                    viewName,
                    viewProperties,
                    updateViewQuery,
                    updateViewFields,
                    aggregations,
                    formats,
                    updateRowLimit);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // If server returns an exception when the listName element is not the name or GUID of a list, then capture below requirement.
                Site.CaptureRequirementIfIsNotNull(
                    soapException,
                    13,
                    @"[In listName] If the value of listName element is not the name or GUID of a list, the operation MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response.");
        }
Example #8
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.)");
        }
        /// <summary>
        /// Used to validate the GetView result.
        /// </summary>
        /// <param name="getViewResult">Specify the result of the GetView operation.</param>
        private void ValidateGetViewResult(GetViewResponseGetViewResult getViewResult)
        {
            // Since the operation succeeds without SOAP exception, this requirement MS-VIEWSS_R8007 can be verified directly.
            Site.CaptureRequirement(
                8007,
                @"[In GetView] The definition of the GetView operation is as follows.
                                <wsdl:operation name=""GetView"">
                                    <wsdl:input message=""tns:GetViewSoapIn"" />
                                    <wsdl:output message=""tns:GetViewSoapOut"" />
                                </wsdl:operation>");

            // If the schema validation succeeds, then MS-VIEWSS_R291 can be captured.
            Site.CaptureRequirementIfIsTrue(
                this.PassSchemaValidation,
                291,
                @"[In GetViewSoapOut] The SOAP body contains a GetViewResponse element (section 3.1.4.3.2.2).");

            // Since the operation succeeds without SOAP exception, then MS-VIEWSS_R108 can be captured.
            Site.CaptureRequirementIfIsTrue(
                this.PassSchemaValidation,
                108,
                @"[In GetView] The protocol client sends a GetViewSoapIn request message (section 3.1.4.3.1.1), and the protocol server responds with a GetViewSoapOut response (section 3.1.4.3.1.2).");

            // If schema has been validated before de-serialization; so this requirement MS-VIEWSS_R110 can be captured.
            Site.CaptureRequirementIfIsTrue(
                this.PassSchemaValidation,
                110,
                @"[In GetViewResponse] The type of the View element is BriefViewDefinition, which is specified in section 2.2.4.1.");

            // If the schema validation succeeds, the requirement R168 can be captured. 
            Site.CaptureRequirementIfIsTrue(
                this.PassSchemaValidation,
                168,
                @"[In GetViewResponse] The definition of the GetViewResponse element is as follows.
                                                                            <s:element name=""GetViewResponse"">
                                                                              <s:complexType>
                                                                                <s:sequence>
                                                                                  <s:element name=""GetViewResult"" minOccurs=""1"" maxOccurs=""1"">
                                                                                    <s:complexType>
                                                                                      <s:sequence>
                                                                                        <s:element name=""View"" type=""tns:BriefViewDefinition"" minOccurs=""1"" maxOccurs=""1""/>
                                                                                      </s:sequence>
                                                                                    </s:complexType>
                                                                                  </s:element>
                                                                                </s:sequence>
                                                                              </s:complexType>
                                                                            </s:element>");

            // Verify the BriefViewDefinition type.
            this.ValidateBriefViewDefinition(getViewResult.View);
        }