Пример #1
0
        /// <summary>
        /// Verifies the response of GetMeetingWorkspaces.
        /// </summary>
        /// <param name="result">The response information of GetMeetingWorkspaces</param>
        private void VerifyGetMeetingWorkspacesResponse(GetMeetingWorkspacesResponseGetMeetingWorkspacesResult result)
        {
            bool isResponseValid = ValidationResult.Success == SchemaValidation.ValidationResult;

            // If the server response pass the validation successfully, we can make sure that the server responds with a GetMeetingWorkspacesSoapOut response message, MS-MEETS_R218 and MS-MEETS_R4008 can be verified.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                218,
                @"[In GetMeetingWorkspaces]This operation [GetMeetingWorkspaces]is defined as follows. 
                <wsdl:operation name=""GetMeetingWorkspaces"">
                <wsdl:input message=""GetMeetingWorkspacesSoapIn"" />
                <wsdl:output message=""GetMeetingWorkspacesSoapOut"" />
                </wsdl:operation>");

            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                4008,
                @"[In GetMeetingWorkspaces][If the protocol client sends a GetMeetingWorkspacesSoapIn request message], and the protocol server responds with a GetMeetingWorkspacesSoapOut response message section (3.1.4.6.1.2).");

            // Verifies MS-MEETS requirement: MS-MEETS_R226.
            Site.CaptureRequirementIfIsTrue(
                this.ResponseExists(SchemaValidation.LastRawResponseXml, "GetMeetingWorkspacesResponse"),
                226,
                @"[In GetMeetingWorkspacesSoapOut]The SOAP body contains a GetMeetingWorkspacesResponse element (section 3.1.4.6.2.2).");

            // If the server response pass the validation successfully, we can make sure that the GetMeetingWorkspacesResponse is defined according to the schema.
            // Verifies MS-MEETS requirement: MS-MEETS_R232.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                232,
                  @"[In GetMeetingWorkspacesResponse]This element[GetMeetingWorkspacesResponse]is defined as follows.
                 <s:element name=""GetMeetingWorkspacesResponse"">
                  <s:complexType>
                    <s:sequence>
                      <s:element name=""GetMeetingWorkspacesResult"" minOccurs=""0"">
                        <s:complexType mixed=""true"">
                          <s:sequence>
                            <s:element name=""MeetingWorkspaces"" minOccurs=""0"">
                              <s:complexType>
                                <s:sequence>
                                  <s:element minOccurs=""0"" maxOccurs=""unbounded"" name=""Workspace"" type=""tns:Workspace""/>
                                </s:sequence>
                              </s:complexType>
                            </s:element>
                          </s:sequence>
                        </s:complexType>
                      </s:element>
                    </s:sequence>
                  </s:complexType>
                </s:element>");

            if (result != null)
            {
                // If the GetMeetingWorkspacesResult element exist, and the server response pass the validation successfully, 
                // we can make sure GetMeetingWorkspacesResult is defined according to the schema.
                // Verifies MS-MEETS requirement: MS-MEETS_R233.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    233,
                    @"[In GetMeetingWorkspacesResponse]GetMeetingWorkspacesResult: The response XML consists of one element containing a list of meeting workspaces.");

                if (this.ElementExists(SchemaValidation.LastRawResponseXml, "Workspace"))
                {
                    // If the Workspace element exist, and the server response pass the validation successfully, 
                    // we can make sure Workspace is defined according to the schema.
                    // Verifies MS-MEETS requirement: MS-MEETS_R23201.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        23201,
                        @"[In GetMeetingWorkspacesResponse][Workspace complex type is defined as follows:]
                    <s:complexType name=""Workspace"">
                      <s:attribute name=""Url"" type=""s:string""/>
                      <s:attribute name=""Title"" type=""s:string""/>
                    </s:complexType>");
                }
            }
        }