public void MSVIEWSS_S02_TC01_GetViewCollection_Success() { // Call AddView method twice to add two views for the specified list on the server. this.AddView(false, Query.AvailableQueryInfo, ViewType.Grid); this.AddView(false, Query.AvailableQueryInfo, ViewType.Calendar); // Call GetViewCollection to retrieve the collection of list views of a specified list in the server. string listName = TestSuiteBase.ListGUID; GetViewCollectionResponseGetViewCollectionResult getViewCollection = Adapter.GetViewCollection(listName); this.Site.Assert.IsNotNull(getViewCollection, "There SHOULD be a view collection returned from a successful GetViewCollection operation."); foreach (GetViewCollectionResponseGetViewCollectionResultView view in getViewCollection.Views) { // The existence of the attribute Name of the view indicates the attribute group of type ViewAttributeGroup exists, then the following requirement can be captured. Site.CaptureRequirementIfIsNotNull( view.Name, 113, @"[In GetViewCollectionResponse] It [the GetViewCollectionResult element] MUST include the collection of View elements of the specified list, which includes an attribute group of type ViewAttributeGroup."); // If the value of FrameState is set to "Normal" or "Minimized", then the following requirement can be captured. bool isValidated = view.FrameState == "Normal" || view.FrameState == "Minimized"; Site.CaptureRequirementIfIsTrue( isValidated, "MS-WSSCAML", 810, @"[In Attributes] [The attribute of ViewDefinition type]FrameState: MUST be set to ""Normal"" or ""Minimized"". "); } }
/// <summary> /// Used to validate the GetViewCollection result. /// </summary> /// <param name="getViewCollectionResult">Specify the result of the GetViewCollection operation.</param> private void ValidateGetViewCollectionResult(GetViewCollectionResponseGetViewCollectionResult getViewCollectionResult) { // Since the operation succeeds without SOAP exception, we can validate this MS-VIEWSS_R8009 requirement directly. Site.CaptureRequirement( 8009, @"[In GetViewCollection] The definition of the GetViewCollection operation is as follows. <wsdl:operation name=""GetViewCollection""> <wsdl:input message=""tns:GetViewCollectionSoapIn"" /> <wsdl:output message=""tns:GetViewCollectionSoapOut"" /> </wsdl:operation>"); // Since the operation succeeds without SOAP exception, then the requirement MS-VIEWSS_R112 can be captured directly Site.CaptureRequirementIfIsTrue( this.PassSchemaValidation, 112, @"[In GetViewCollection] The protocol client sends a GetViewCollectionSoapIn request message (section 3.1.4.4.1.1), and the protocol server responds with a GetViewCollectionSoapOut response message (section 3.1.4.4.1.2)."); // If the schema validation succeeds, then requirement MS-VIEWSS_R299 can be captured. Site.CaptureRequirementIfIsTrue( this.PassSchemaValidation, 299, @"[In GetViewCollectionSoapOut] The SOAP body contains a GetViewCollectionResponse element (section 3.1.4.4.2.2)."); // Since the schema validation succeeds then requirement R170 can be captured. Site.CaptureRequirementIfIsTrue( this.PassSchemaValidation, 170, @"[In GetViewCollectionResponse] The definition of the GetViewCollectionResponse element is as follows. <s:element name=""GetViewCollectionResponse""> <s:complexType> <s:sequence> <s:element name=""GetViewCollectionResult"" minOccurs=""1"" maxOccurs=""1""> <s:complexType> <s:sequence> <s:element name=""Views"" minOccurs=""1"" maxOccurs=""1""> <s:complexType> <s:sequence> <s:element name=""View"" minOccurs=""0"" maxOccurs=""unbounded""> <s:complexType> <s:attributeGroup ref=""tns:ViewAttributeGroup""/> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>"); // Verify MS-VIEWSS requirement: MS-VIEWSS_R161 // In the XSD, the both attribute definition are the same, so if the schema validation succeeds, then the requirement R161 can be captured. Site.CaptureRequirementIfIsTrue( this.PassSchemaValidation, 161, @"[In ViewAttributeGroup] All attributes specified by ViewAttributeGroup are the same as those specified by the ViewDefinition complex type as specified in [MS-WSSCAML] section 2.3.2.17."); foreach (GetViewCollectionResponseGetViewCollectionResultView view in getViewCollectionResult.Views) { // If the URL is server-relative URL and the schema validation succeeds, then capture requirement R114. Site.CaptureRequirementIfIsTrue( this.IsServerRelativeUrl(view.Url) && this.PassSchemaValidation, 114, "[In GetViewCollectionResponse] The attribute group ViewAttributeGroup is specified in section 2.2.8.1, with the following exception: The Url attribute MUST be the server-relative URL of the list view."); } }