/// <summary>
        /// Capture requirements for Scope structure
        /// </summary>
        /// <param name="scopes">Scope structure</param>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureScopesElementRequirements(ScopesType scopes, ITestSite site)
        {
            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);

            site.CaptureRequirementIfIsNotNull(
                scopes,
                55,
                @"[In Scopes] Each element in the list is actually a UTF-8-encoded string representation of 
                the HoHoDk value in hexBinary format [XMLSCHEMA1.1/2] [and represents one segment].");

            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);
            site.CaptureRequirementIfIsTrue(
                scopes.Text.Length > 0,
                158,
                @"[The <Scopes> element represents the list of discovery provider scopes, where]
                each element in the list is a string.");
        }
        /// <summary>
        /// Capture requirements for Scope structure
        /// </summary>
        /// <param name="scopes">Scope structure</param>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureScopesElementRequirements(ScopesType scopes, ITestSite site)
        {
            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);

            site.CaptureRequirementIfIsNotNull(
                scopes,
                55,
                @"[In Scopes] Each element in the list is actually a UTF-8-encoded string representation of
                the HoHoDk value in hexBinary format [XMLSCHEMA1.1/2] [and represents one segment].");

            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);
            site.CaptureRequirementIfIsTrue(
                scopes.Text.Length > 0,
                158,
                @"[The <Scopes> element represents the list of discovery provider scopes, where]
                each element in the list is a string.");
        }
        /// <summary>
        /// Capture requirements related with AmIAlone Sub-request.
        /// </summary>
        /// <param name="amIAloneSubResponse">Containing the AmIAloneSubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateAmIAloneSubResponse(AmIAloneSubResponseType amIAloneSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R22555
            site.CaptureRequirement(
                "MS-FSSHTTP",
                22555,
                @"[In AmIAloneSubResponseType]	
  <xs:complexType name=""AmIAloneSubResponseType"" >
   < xs:complexContent >
    < xs:extension base = ""tns:SubResponseType"" >
      < xs:sequence minOccurs = ""0"" maxOccurs = ""1"" >
         < xs:element name = ""SubResponseData"" type = ""tns:AmIAloneSubResponseDataType"" />
      </ xs:sequence >
    </ xs:extension >
  </ xs:complexContent >
</ xs:complexType > ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2256
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2256,
                @"[In AmIAloneSubResponseType]SubResponseData: An AmIAloneSubResponseDataType that specifies the information about whether the user is alone that was requested as part of the AmIAlone subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2363
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(AmIAloneSubResponseType),
                amIAloneSubResponse.GetType(),
                "MS-FSSHTTP",
                2363,
                @"[AmIAlone Subrequest]The protocol server responds with an AmIAlone SubResponse message, which is of type AmIAloneSubResponseType as specified in section 2.3.1.48. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2146
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(AmIAloneSubResponseType),
                amIAloneSubResponse.GetType(),
                "MS-FSSHTTP",
                2146,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: AmIAloneSubResponseType");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2164
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(AmIAloneSubResponseType),
                amIAloneSubResponse.GetType(),
                "MS-FSSHTTP",
                2164,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: AmIAloneSubResponseType.");

            ErrorCodeType errorCode;

            site.Assert.IsTrue(Enum.TryParse <ErrorCodeType>(amIAloneSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", amIAloneSubResponse.ErrorCode);
            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2158
                site.CaptureRequirementIfIsNotNull(
                    amIAloneSubResponse.SubResponseData,
                    "MS-FSSHTTP",
                    2158,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""AmIAlone"".");
            }

            // Verify requirements related with its base type: SubResponseType
            ValidateSubResponseType(amIAloneSubResponse as SubResponseType, site);

            // Verify requirements related with SubResponseDataType
            if (amIAloneSubResponse.SubResponseData != null)
            {
                ValidateAmIAloneSubResponseDataType(amIAloneSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// This method is used to test Sub-Responses related adapter requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyFsshttpbSubResponse(FsshttpbSubResponse instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Sub-Responses related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FsshttpbSubResponse is null due to parsing error or type casting error.");
            }

            // Verify the stream object header related requirements.
            this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);

            // Directly capture requirement MS-FSSHTTPB_R548, if the header start type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     548,
                     @"[In Sub-Responses] Sub-response Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a sub-response start.");

            RequestTypes expectTypeValue = MsfsshttpbSubRequestMapping.GetSubRequestType((int)instance.RequestID.DecodedValue, site);

            // Capture requirement MS-FSSHTTPB_R549, if the request type is consistent with the expected value.
            site.CaptureRequirementIfAreEqual<RequestTypes>(
                     expectTypeValue,
                     (RequestTypes)instance.RequestType.DecodedValue,
                     "MS-FSSHTTPB",
                     549,
                     @"[In Sub-Responses] Request ID (variable): A compact unsigned 64-bit integer (section 2.2.1.1) that specifies the request number this sub-response is for.");

            // Capture requirement MS-FSSHTTPB_R550, if the request type is consistent with the expected value.
            site.CaptureRequirementIfAreEqual<RequestTypes>(
                     expectTypeValue,
                     (RequestTypes)instance.RequestType.DecodedValue,
                     "MS-FSSHTTPB",
                     550,
                     @"[In Sub-Responses] Request Type (variable): A compact unsigned 64-bit integer that specifies the request type (section 2.2.1.6) matching the request.");

            // Verify the request types related requirements.
            this.VerifyRequestTypes((RequestTypes)instance.RequestType.DecodedValue, site);

            if (instance.Status == true)
            {
                site.Log.Add(
                        LogEntryKind.Debug,
                        "When the status is set, the response error should exist.");

                // Capture requirement MS-FSSHTTPB_R552, if the response error is exist when the status is set.
                site.CaptureRequirementIfIsNotNull(
                         instance.ResponseError,
                         "MS-FSSHTTPB",
                         552,
                         @"[In Sub-Responses] A - Status (1 bit): If set, A response error (section 2.2.3.2) MUST follow.");

                // Capture requirement MS-FSSHTTPB_R551, if the response error is exist when the status is set.
                site.CaptureRequirementIfIsNotNull(
                         instance.ResponseError,
                         "MS-FSSHTTPB",
                         551,
                         @"[In Sub-Responses] A - Status (1 bit): If set, a bit that specifies the sub-request has failed.");

                // Directly capture requirement MS-FSSHTTPB_R555, if there are no parsing errors. 
                site.CaptureRequirement(
                         "MS-FSSHTTPB",
                         555,
                         @"[In Sub-Responses] Sub-response data (variable): A response error that specifies the error information about failure of the sub-request.");
            }
            else
            {
                site.Assert.IsNotNull(
                            instance.SubResponseData,
                            "When the status is not set, the response data cannot be null.");

                switch ((int)instance.RequestType.DecodedValue)
                {
                    case 1:
                        site.Assert.AreEqual<Type>(
                                    typeof(QueryAccessSubResponseData),
                                    instance.SubResponseData.GetType(),
                                    "When the request type value equals to 1, then the response data MUST be the type QueryAccessSubResponseData");

                        // Directly capture requirement MS-FSSHTTPB_R578, if the above assertion was validated.
                        site.CaptureRequirement(
                                 "MS-FSSHTTPB",
                                 578,
                                 @"[In Sub-Responses][Request Type is set to ]1 [specifies the Sub-response data is  for the ]Query access (section 2.2.3.1.1)[operation].");
                        break;

                    case 2:
                        site.Assert.AreEqual<Type>(
                                    typeof(QueryChangesSubResponseData),
                                    instance.SubResponseData.GetType(),
                                    "When the request type value equals to 2, then the response data MUST be the type QueryChangesSubResponseData");

                        // Directly capture requirement MS-FSSHTTPB_R579, if the above assertion was validated.
                        site.CaptureRequirement(
                                 "MS-FSSHTTPB",
                                 579,
                                 @"[In Sub-Responses][Request Type is set to ]2 [specifies the Sub-response data is  for the ]Query changes (section 2.2.3.1.2)[operation].");
                        break;

                    case 5:
                        site.Assert.AreEqual<Type>(
                                    typeof(PutChangesSubResponseData),
                                    instance.SubResponseData.GetType(),
                                    "When the request type value equals to 5, then the response data MUST be the type PutChangesSubResponseData");

                        // Directly capture requirement MS-FSSHTTPB_R582, if the above assertion was validated.
                        site.CaptureRequirement(
                                 "MS-FSSHTTPB",
                                 582,
                                 @"[In Sub-Responses][Request Type is set to ]5 [specifies the Sub-response data is  for the ]Put changes (section 2.2.3.1.3)[operation].");
                        break;

                    case 11:
                        site.Assert.AreEqual<Type>(
                                   typeof(AllocateExtendedGuidRangeSubResponseData),
                                   instance.SubResponseData.GetType(),
                                   "When the request type value equals to 11, then the response data MUST be the type AllocateExtendedGuidRangeSubResponseData");
                        break;

                    default:
                        site.Assert.Fail("Unsupported sub request type " + (int)instance.RequestType.DecodedValue);
                        break;
                }

                // If the above asserts are validate, the requirement MS-FSSHTTPB_R5551 can be captured.
                site.CaptureRequirement(
                         "MS-FSSHTTPB",
                         5551,
                         @"[In Sub-Responses] depending on the request type (section 2.2.1.6), [Sub-response data (variable)] specifies additional data. See the following table for details:[of request type number value and operation]");
            }

            // Capture requirement MS-FSSHTTPB_R553, if the reserved value equals to 0. 
            site.CaptureRequirementIfAreEqual<byte>(
                     0,
                     instance.Reserved,
                     "MS-FSSHTTPB",
                     553,
                     @"[In Sub-Responses] Reserved (7 bits): A 7 bit reserved field that MUST be set to zero.");

            // Verify the stream object header end related requirements.
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);

            // Capture requirement MS-FSSHTTPB_R586, if the end type is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     586,
                     @"[In Sub-Responses] Sub-response End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies a sub-response end.");
        }
        /// <summary>
        /// Capture requirements related with Cell Sub-request.
        /// </summary>
        /// <param name="cellSubResponse">Containing the CellSubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateCellSubResponse(CellSubResponseType cellSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R553
            site.CaptureRequirement(
                "MS-FSSHTTP",
                553,
                @"[In CellSubResponseType][CellSubResponseType schema is:]
                     <xs:complexType name=""CellSubResponseType"">
                        <xs:complexContent>
                          <xs:extension base=""tns:SubResponseType"">
                            <xs:sequence>
                               <xs:element name=""SubResponseData"" type=""tns:CellSubResponseDataType"" minOccurs=""0"" maxOccurs=""1"" />
                               <xs:element name=""SubResponseStreamInvalid"" minOccurs=""0"" maxOccurs=""1"" />
                            </xs:sequence>
                          </xs:extension>
                        </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R951
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(CellSubResponseType),
                cellSubResponse.GetType(),
                "MS-FSSHTTP",
                951,
                @"[In Cell Subrequest][The protocol client sends a cell SubRequest message, which is of type CellSubRequestType,] The protocol server responds with a cell SubResponse message, which is of type CellSubResponseType as specified in section 2.3.1.4.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1687
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(CellSubResponseType),
                cellSubResponse.GetType(),
                "MS-FSSHTTP",
                1687,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: CellSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R274
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(CellSubResponseType),
                cellSubResponse.GetType(),
                "MS-FSSHTTP",
                274,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: CellSubResponseType.");

            ErrorCodeType errorCode;

            site.Assert.IsTrue(Enum.TryParse <ErrorCodeType>(cellSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", cellSubResponse.ErrorCode);

            if (cellSubResponse.ErrorCode != null)
            {
                ValidateCellRequestErrorCodeTypes(errorCode, site);
            }

            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R263
                site.Log.Add(
                    LogEntryKind.Debug,
                    "For requirement MS-FSSHTTP_R263, the SubResponseData value should not be NULL when the cell sub-request succeeds, the actual SubResponseData value is: {0}",
                    cellSubResponse.SubResponseData != null ? cellSubResponse.SubResponseData.ToString() : "NULL");

                site.CaptureRequirementIfIsNotNull(
                    cellSubResponse.SubResponseData,
                    "MS-FSSHTTP",
                    263,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""Cell"".");
            }

            // Verify requirements related with its base type : SubResponseType
            ValidateSubResponseType(cellSubResponse as SubResponseType, site);

            // Verify requirements related with CellSubResponseDataType
            if (cellSubResponse.SubResponseData != null)
            {
                ValidateCellSubResponseDataType(cellSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with LockStatusSubResponseDataType
        /// </summary>
        /// <param name="lockStatusSubResponseData">The LockStatusSubResponseData information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateLockStatusSubResponseDataType(LockStatusSubResponseDataType lockStatusSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2382
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2382,
                @"[LockStatus Subrequest]The LockStatusSubResponseDataType defines the type of the SubResponseData element inside the LockStatusSubResponse element. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2266
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2266,
                @"[In LockStatusSubResponseDataType]
	<xs:complexType name=""LockStatusSubResponseDataType"">
	    <xs:attribute name=""LockType"" type=""tns:LockTypes"" use=""optional"" />
	    <xs:attribute name=""LockID"" type=""tns:guid"" use=""optional"" />
	    <xs:attribute name=""LockedBy"" type=""xs:string"" use=""optional"" />
	</xs:complexType>"    );

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2135
            // The SubResponseData of LockStatusSubResponse is of type LockStatusSubResponseDataType, so if lockStatusSubResponse.SubResponseData is not null, then MS-FSSHTTP_R2135 can be captured.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(LockStatusSubResponseDataType),
                lockStatusSubResponseData.GetType(),
                "MS-FSSHTTP",
                2135,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table]LockStatusSubResponseDataType:Type definition for Lock Status subresponse data.");

            if (lockStatusSubResponseData.LockID != null)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2182
                site.CaptureRequirementIfIsNotNull(
                    lockStatusSubResponseData.LockID,
                    "MS-FSSHTTP",
                    2182,
                    @"[In SubResponseDataOptionalAttributes]LockedID: A guid that specifies the id of the lock.");

                // MS-FSSHTTP_R2182 is verified,so MS-FSSHTTP_R22699 can be verified directly
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    22699,
                    @"[In LockStatusSubResponseDataType]LockedID: A guid that specifies the id of the lock.");
            }

            if (lockStatusSubResponseData.LockedBy != null)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2183
                site.CaptureRequirementIfIsNotNull(
                    lockStatusSubResponseData.LockedBy,
                    "MS-FSSHTTP",
                    2183,
                    @"[In SubResponseDataOptionalAttributes]LockedBy: A string that specifies the user that has the file locked, if any.");

                // MS-FSSHTTP_R2183 is verified,so MS-FSSHTTP_R2270 can be verified directly
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2270,
                    @"[In LockStatusSubResponseDataType]LockedBy: A string that specifies the user that has the file locked, if any.");
            }

            if (lockStatusSubResponseData.LockTypeSpecified)
            {
                ValidateLockTypes(site);

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2267
                site.CaptureRequirementIfIsNotNull(
                    lockStatusSubResponseData.LockType,
                    "MS-FSSHTTP",
                    2267,
                    @"[In LockStatusSubResponseDataType]LockType: A LockTypes that specifies the type of lock granted in a coauthoring subresponse. ");
            }
        }
        /// <summary>
        /// Capture requirements related with WhoAmI Sub-request.
        /// </summary>
        /// <param name="whoamiSubResponse">Containing the WhoAmISubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateWhoAmISubResponse(WhoAmISubResponseType whoamiSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R765
            site.CaptureRequirement(
                "MS-FSSHTTP",
                765,
                @"[In WhoAmISubResponseType][WhoAmISubResponseType schema is:]
                     <xs:complexType name=""WhoAmISubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                           <xs:sequence minOccurs=""0"" maxOccurs=""1"">
                              <xs:element name=""SubResponseData"" type=""tns:WhoAmISubResponseDataType""/>
                           </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1316
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(WhoAmISubResponseType),
                whoamiSubResponse.GetType(),
                "MS-FSSHTTP",
                1316,
                @"[In WhoAmI Subrequest][The protocol client sends a WhoAmI SubRequest message, which is of type WhoAmISubRequestType] The protocol server responds with a WhoAmI SubResponse message, which is of type WhoAmISubResponseType as specified in section 2.3.1.22.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4692
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(WhoAmISubResponseType),
                whoamiSubResponse.GetType(),
                "MS-FSSHTTP",
                4692,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: WhoAmISubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5746
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(WhoAmISubResponseType),
                whoamiSubResponse.GetType(),
                "MS-FSSHTTP",
                5746,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: WhoAmISubResponseType.");

            ErrorCodeType errorCode;

            site.Assert.IsTrue(Enum.TryParse <ErrorCodeType>(whoamiSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", whoamiSubResponse.ErrorCode);
            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R268
                site.CaptureRequirementIfIsNotNull(
                    whoamiSubResponse.SubResponseData,
                    "MS-FSSHTTP",
                    268,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""WhoAmI"".");
            }

            // Verify requirements related with its base type: SubResponseType
            ValidateSubResponseType(whoamiSubResponse as SubResponseType, site);

            // Verify requirements related with SubResponseDataType
            if (whoamiSubResponse.SubResponseData != null)
            {
                ValidateWhoAmISubResponseDataType(whoamiSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with ServerTime Sub-request.
        /// </summary>
        /// <param name="servertimeSubResponse">The SubResponse information.</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateServerTimeSubResponse(ServerTimeSubResponseType servertimeSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4691
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(ServerTimeSubResponseType),
                servertimeSubResponse.GetType(),
                "MS-FSSHTTP",
                4691,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: ServerTimeSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5745
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(ServerTimeSubResponseType),
                servertimeSubResponse.GetType(),
                "MS-FSSHTTP",
                5745,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: ServerTimeSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R746
            site.CaptureRequirement(
                "MS-FSSHTTP",
                746,
                @"[In ServerTimeSubResponseType][ServerTimeSubResponseType schema is:]
                     <xs:complexType name=""ServerTimeSubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                          <xs:sequence minOccurs=""1"" maxOccurs=""1"">
                            <xs:element name=""SubResponseData"" type=""tns:ServerTimeSubResponseDataType""/>
                          </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1331
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(ServerTimeSubResponseType),
                servertimeSubResponse.GetType(),
                "MS-FSSHTTP",
                1331,
                @"[In ServerTime Subrequest][The protocol client sends a ServerTime SubRequest message, which is of ServerTimeSubRequestType] The protocol server responds with a ServerTime SubResponse message, which is of type ServerTimeSubResponseType as specified in section 2.3.1.19.");

            ErrorCodeType errorCode;

            site.Assert.IsTrue(Enum.TryParse <ErrorCodeType>(servertimeSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", servertimeSubResponse.ErrorCode);
            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R266
                // If servertimeSubResponse.SubResponseData is not null, SubResponseData element is sent.
                site.Log.Add(
                    LogEntryKind.Debug,
                    "For requirement MS-FSSHTTP_R266, the SubResponseData element should be sent as part of the SubResponse element in a cell storage service response message, the actual SubResponseData value is: {0}",
                    servertimeSubResponse.SubResponseData != null ? servertimeSubResponse.SubResponseData.ToString() : "NULL");

                site.CaptureRequirementIfIsNotNull(
                    servertimeSubResponse.SubResponseData,
                    "MS-FSSHTTP",
                    266,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""ServerTime"".");
            }

            // Verify requirements related with its base type: SubResponseType
            ValidateSubResponseType(servertimeSubResponse as SubResponseType, site);

            // Verify requirements related with ServerTimeSubResponseDataType
            if (servertimeSubResponse.SubResponseData != null)
            {
                ValidateServerTimeSubResponseDataType(servertimeSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with Response element.
        /// </summary>
        /// <param name="response">The Response information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateResponseElement(Response response, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R97
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     97,
                     @"[In Response][Response element schema is:]
                     <xs:element name=""Response"">
                       <!--Allows for the numbers to be displayed between the SubResponse elements-->
                       <xs:complexType mixed=""true"">
                         <xs:sequence minOccurs=""1"" maxOccurs=""unbounded"">
                           <xs:element name=""SubResponse"" type=""tns:SubResponseElementGenericType"" /> 
                         </xs:sequence>
                         <xs:attribute name=""Url"" type=""xs:string"" use=""required""/>
                         <xs:attribute name=""RequestToken"" type=""xs:nonNegativeInteger"" use=""required"" />
                         <xs:attribute name=""HealthScore"" type=""xs:integer"" use=""required""/>
                         <xs:attribute name=""ErrorCode"" type=""tns:GenericErrorCodeTypes"" use=""optional"" />
                         <xs:attribute name=""ErrorMessage"" type=""xs:string"" use=""optional""/>
                       </xs:complexType>
                     </xs:element>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R104
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R104, the Url attribute value should be specified, the actual Url value is: {0}",
                response.Url != null ? response.Url : "NULL");

            site.CaptureRequirementIfIsNotNull(
                     response.Url,
                     "MS-FSSHTTP",
                     104,
                     @"[In Response] The Url attribute MUST be specified for each Response element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1482
            // The responseElement.SubResponse.Length specifies the number of SubResponse element in Response.
            bool isVerifiedR96 = response.SubResponse.Length >= 1;
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R1482, the Response element should contain one or more SubResponse elements, the actual SubResponse elements number is: {0}",
                response.SubResponse.Length.ToString());

            site.CaptureRequirementIfIsTrue(
                     isVerifiedR96,
                     "MS-FSSHTTP",
                     96,
                     @"[In Response] Each Response element MUST contain one or more SubResponse elements.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R107
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R263, the RequestToken should be specified, the actual RequestToken value is: {0}",
                response.RequestToken != null ? response.RequestToken : "NULL");

            site.CaptureRequirementIfIsNotNull(
                     response.RequestToken,
                     "MS-FSSHTTP",
                     107,
                     @"[In Response] The RequestToken MUST be specified for each Response element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2076
            bool isVerifyR2076 = int.Parse(response.HealthScore) <= 10 && int.Parse(response.HealthScore) >= 0;
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R2076, the HealthScore value should be between 0 and 10, the actual HealthScore value is: {0}",
                response.HealthScore);

            site.CaptureRequirementIfIsTrue(
                     isVerifyR2076,
                     "MS-FSSHTTP",
                     2076,
                     @"[In Response] HealthScore: An integer which value is between 0 and 10.");

            // Verify requirements related with SubResponse element
            if (response.SubResponse != null)
            {
                foreach (SubResponseElementGenericType subResponse in response.SubResponse)
                {
                    ValidateSubResponseElement(subResponse, site);
                }
            }

            // Verify requirements related with GenericErrorCodeTypes
            if (response.ErrorCodeSpecified)
            {
                ValidateGenericErrorCodeTypes(site);
            }
        }
        /// <summary>
        /// Capture requirements related to GetDocMetaInfo sub response.
        /// </summary>
        /// <param name="getDocMetaInfoSubResponse">Containing the GetDocMetaInfoSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateGetDocMetaInfoSubResponse(GetDocMetaInfoSubResponseType getDocMetaInfoSubResponse, ITestSite site)
        {
            ValidateSubResponseType(getDocMetaInfoSubResponse as SubResponseType, site);

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1797
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1797,
                     @"[In GetDocMetaInfoSubResponseType][The schema of GetDocMetaInfoSubResponseType is] <xs:complexType name=""GetDocMetaInfoSubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                           <xs:sequence minOccurs=""0"" maxOccurs=""1"">
                     <xs:element name=""SubResponseData"" type=""tns:GetDocMetaInfoSubResponseDataType""/>
                     </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2003
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2003,
                     @"[In GetDocMetaInfo Subrequest][The protocol client sends a GetDocMetaInfo SubRequest message, which is of type GetDocMetaInfoSubRequestType] The protocol server responds with a GetDocMetaInfo SubResponse message, which is of type GetDocMetaInfoSubResponseType as specified in section 2.3.1.30.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4694
            // if can launch this method, the schema matches.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(GetDocMetaInfoSubResponseType),
                     getDocMetaInfoSubResponse.GetType(),
                     "MS-FSSHTTP",
                     4694,
                     @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: GetDocMetaInfoSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5748
            // if can launch this method, the schema matches.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(GetDocMetaInfoSubResponseType),
                     getDocMetaInfoSubResponse.GetType(),
                     "MS-FSSHTTP",
                     5748,
                     @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: GetDocMetaInfoSubResponseType.");

            if (getDocMetaInfoSubResponse.SubResponseData != null)
            {
                ValidateGetDocMetaInfoSubResponseData(site);
            }

            if (string.Compare("Success", getDocMetaInfoSubResponse.ErrorCode, StringComparison.OrdinalIgnoreCase) == 0)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1693
                bool isVerifyR1693 = getDocMetaInfoSubResponse.SubResponseData != null;

                // If popup the assert, the case run fail. 
                site.Assert.IsTrue(
                            isVerifyR1693,
                            "For requirement MS-FSSHTTPB_R1693, the SubResponseData should not be NULL.");

                // If the above logic is right, MS-FSSHTTP_R1693 can be captured.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         1693,
                         @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""GetDocMetaInfo"".");

                // If the value of element "SubResponseData" in the sub-response is not null, then capture MS-FSSHTTP_R1800.
                site.CaptureRequirementIfIsNotNull(
                         getDocMetaInfoSubResponse.SubResponseData,
                         "MS-FSSHTTP",
                         1800,
                         @"[In GetDocMetaInfoSubResponseType] [In GetDocMetaInfoSubResponseType] As part of processing the GetDocMetaInfo subrequest, the SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the following condition is true:
                         The ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"".");
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2013
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2013,
                     @"[In GetDocMetaInfo Subrequest] The GetDocMetaInfoPropertySetType elements have one Property element per metadata item of type GetDocMetaInfoPropertyType as defined in section 2.3.1.29.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1685
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1685,
                     @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] GetDocMetaInfoSubResponseDataType: Type definition for Get Doc Meta Info subresponse data.");
        }
        /// <summary>
        /// Capture requirements related with SubResponseType
        /// </summary>
        /// <param name="subResponse">The SubResponseType information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateSubResponseType(SubResponseType subResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R281
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     281,
                     @"[In SubResponseType][SubResponseType schema is:]
                     <xs:complexType name=""SubResponseType"">
                        <xs:attribute name=""SubRequestToken"" type=""xs:nonNegativeInteger"" use=""required""/>
                        <xs:attribute name=""ErrorCode"" type=""tns:ErrorCodeTypes"" use=""required"" />
                        <xs:attribute name=""HResult"" type=""xs:integer"" use=""required"" fixed=""0""/>
                        <xs:attribute name=""ErrorMessage"" type=""xs:string"" use=""optional""/> 
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R284
            // If the SubRequestToken attribute isn't null, then capture MS-FSSHTTP_R284.  
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R284, the SubRequestToken should be specified, the actual SubRequestToken value is: {0}",
                subResponse.SubRequestToken != null ? subResponse.SubRequestToken : "NULL");

            site.CaptureRequirementIfIsNotNull(
                     subResponse.SubRequestToken,
                     "MS-FSSHTTP",
                     284,
                     @"[In SubResponseType] The SubRequestToken attribute MUST be specified for a SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R290
            // If the ErrorCode attribute is not null, capture R290.
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R290, the ErrorCode attribute should be specified, the actual ErrorCode value is: {0}",
                subResponse.ErrorCode != null ? subResponse.ErrorCode : "NULL");

            site.CaptureRequirementIfIsNotNull(
                     subResponse.ErrorCode,
                     "MS-FSSHTTP",
                     290,
                     @"[In SubResponseType] The ErrorCode attribute MUST be specified for a SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1003
            site.CaptureRequirementIfIsNotNull(
                     subResponse.ErrorCode,
                     "MS-FSSHTTP",
                     1003,
                     @"[In Coauth Subrequest][The protocol server returns results based on the following conditions:]  Depending on the type of error, ErrorCode is returned as an attribute of the SubResponse element.");

            if (subResponse.ErrorCode != null)
            {
                ErrorCodeType errorCode;
                site.Assert.IsTrue(Enum.TryParse<ErrorCodeType>(subResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", subResponse.ErrorCode);

                // Verify requirements related with ErrorCodeTypes
                ValidateErrorCodeTypes(errorCode, site);
            }
        }
        /// <summary>
        /// Capture requirements related with ResponseCollection
        /// </summary>
        /// <param name="responseCollection">The ResponseCollection information</param>
        /// <param name="requestToken">The expected RequestToken</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateResponseCollection(ResponseCollection responseCollection, string requestToken, ITestSite site)
        {
            // Verify MS-FSSHTTP_R19
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     19,
                     @"[In Response] [The Body element of each SOAP response message MUST contain] zero or more ResponseCollection elements.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R121
            // If WebUrl is not null, WebUrl attribute is specified.
            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R121, the WebUrl attribute should be specified, the actual WebUrl value is: {0}",
                responseCollection.WebUrl != null ? responseCollection.WebUrl : "NULL");

            site.CaptureRequirementIfIsNotNull(
                     responseCollection.WebUrl,
                     "MS-FSSHTTP",
                     121,
                     @"[In ResponseCollection] The WebUrl attribute MUST be specified for each ResponseCollection element.");

            // Now here only supported one request.
            if (responseCollection.Response != null && responseCollection.Response.Length >= 1)
            {
                MsfsshttpAdapterCapture.ValidateResponseElement(responseCollection.Response[0], site);
                MsfsshttpAdapterCapture.ValidateResponseToken(responseCollection.Response[0], requestToken, site);
            }
        }
        /// <summary>
        /// Capture requirements related with WhoAmI Sub-request.
        /// </summary>
        /// <param name="whoamiSubResponse">Containing the WhoAmISubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateWhoAmISubResponse(WhoAmISubResponseType whoamiSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R765
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     765,
                     @"[In WhoAmISubResponseType][WhoAmISubResponseType schema is:]
                     <xs:complexType name=""WhoAmISubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                           <xs:sequence minOccurs=""0"" maxOccurs=""1"">
                              <xs:element name=""SubResponseData"" type=""tns:WhoAmISubResponseDataType""/>
                           </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1316
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(WhoAmISubResponseType),
                     whoamiSubResponse.GetType(),
                     "MS-FSSHTTP",
                     1316,
                     @"[In WhoAmI Subrequest][The protocol client sends a WhoAmI SubRequest message, which is of type WhoAmISubRequestType] The protocol server responds with a WhoAmI SubResponse message, which is of type WhoAmISubResponseType as specified in section 2.3.1.22.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4692
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(WhoAmISubResponseType),
                     whoamiSubResponse.GetType(),
                     "MS-FSSHTTP",
                     4692,
                     @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: WhoAmISubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5746
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(WhoAmISubResponseType),
                     whoamiSubResponse.GetType(),
                     "MS-FSSHTTP",
                     5746,
                     @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: WhoAmISubResponseType.");

            ErrorCodeType errorCode;
            site.Assert.IsTrue(Enum.TryParse<ErrorCodeType>(whoamiSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", whoamiSubResponse.ErrorCode);
            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R268
                site.CaptureRequirementIfIsNotNull(
                         whoamiSubResponse.SubResponseData,
                         "MS-FSSHTTP",
                         268,
                         @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""WhoAmI"".");
            }

            // Verify requirements related with its base type: SubResponseType
            ValidateSubResponseType(whoamiSubResponse as SubResponseType, site);

            // Verify requirements related with SubResponseDataType
            if (whoamiSubResponse.SubResponseData != null)
            {
                ValidateWhoAmISubResponseDataType(whoamiSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with Cell Sub-request.
        /// </summary>
        /// <param name="cellSubResponse">Containing the CellSubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateCellSubResponse(CellSubResponseType cellSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R553
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     553,
                     @"[In CellSubResponseType][CellSubResponseType schema is:]
                     <xs:complexType name=""CellSubResponseType"">
                        <xs:complexContent>
                          <xs:extension base=""tns:SubResponseType"">
                            <xs:sequence>
                               <xs:element name=""SubResponseData"" type=""tns:CellSubResponseDataType"" minOccurs=""0"" maxOccurs=""1"" />
                               <xs:element name=""SubResponseStreamInvalid"" minOccurs=""0"" maxOccurs=""1"" />
                            </xs:sequence>
                          </xs:extension>
                        </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R951
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(CellSubResponseType),
                     cellSubResponse.GetType(),
                     "MS-FSSHTTP",
                     951,
                     @"[In Cell Subrequest][The protocol client sends a cell SubRequest message, which is of type CellSubRequestType,] The protocol server responds with a cell SubResponse message, which is of type CellSubResponseType as specified in section 2.3.1.4.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1687
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(CellSubResponseType),
                     cellSubResponse.GetType(),
                     "MS-FSSHTTP",
                     1687,
                     @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: CellSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R274
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(CellSubResponseType),
                     cellSubResponse.GetType(),
                     "MS-FSSHTTP",
                     274,
                     @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: CellSubResponseType.");

            ErrorCodeType errorCode;
            site.Assert.IsTrue(Enum.TryParse<ErrorCodeType>(cellSubResponse.ErrorCode, true, out errorCode), "Fail to convert the error code string {0} to the Enum type ErrorCodeType", cellSubResponse.ErrorCode);

            if (cellSubResponse.ErrorCode != null)
            {
                ValidateCellRequestErrorCodeTypes(errorCode, site);
            }

            if (errorCode == ErrorCodeType.Success)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R263
                site.Log.Add(
                    LogEntryKind.Debug,
                    "For requirement MS-FSSHTTP_R263, the SubResponseData value should not be NULL when the cell sub-request succeeds, the actual SubResponseData value is: {0}",
                    cellSubResponse.SubResponseData != null ? cellSubResponse.SubResponseData.ToString() : "NULL");

                site.CaptureRequirementIfIsNotNull(
                         cellSubResponse.SubResponseData,
                         "MS-FSSHTTP",
                         263,
                         @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""Cell"".");
            }

            // Verify requirements related with its base type : SubResponseType
            ValidateSubResponseType(cellSubResponse as SubResponseType, site);

            // Verify requirements related with CellSubResponseDataType
            if (cellSubResponse.SubResponseData != null)
            {
                ValidateCellSubResponseDataType(cellSubResponse.SubResponseData, site);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Capture requirements related to GetDocMetaInfo sub response.
        /// </summary>
        /// <param name="getDocMetaInfoSubResponse">Containing the GetDocMetaInfoSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateGetDocMetaInfoSubResponse(GetDocMetaInfoSubResponseType getDocMetaInfoSubResponse, ITestSite site)
        {
            ValidateSubResponseType(getDocMetaInfoSubResponse as SubResponseType, site);

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1797
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1797,
                @"[In GetDocMetaInfoSubResponseType][The schema of GetDocMetaInfoSubResponseType is] <xs:complexType name=""GetDocMetaInfoSubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                           <xs:sequence minOccurs=""0"" maxOccurs=""1"">
                     <xs:element name=""SubResponseData"" type=""tns:GetDocMetaInfoSubResponseDataType""/>
                     </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2003
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2003,
                @"[In GetDocMetaInfo Subrequest][The protocol client sends a GetDocMetaInfo SubRequest message, which is of type GetDocMetaInfoSubRequestType] The protocol server responds with a GetDocMetaInfo SubResponse message, which is of type GetDocMetaInfoSubResponseType as specified in section 2.3.1.30.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4694
            // if can launch this method, the schema matches.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(GetDocMetaInfoSubResponseType),
                getDocMetaInfoSubResponse.GetType(),
                "MS-FSSHTTP",
                4694,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: GetDocMetaInfoSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5748
            // if can launch this method, the schema matches.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(GetDocMetaInfoSubResponseType),
                getDocMetaInfoSubResponse.GetType(),
                "MS-FSSHTTP",
                5748,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: GetDocMetaInfoSubResponseType.");

            if (getDocMetaInfoSubResponse.SubResponseData != null)
            {
                ValidateGetDocMetaInfoSubResponseData(site);
            }

            if (string.Compare("Success", getDocMetaInfoSubResponse.ErrorCode, StringComparison.OrdinalIgnoreCase) == 0)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1693
                bool isVerifyR1693 = getDocMetaInfoSubResponse.SubResponseData != null;

                // If popup the assert, the case run fail.
                site.Assert.IsTrue(
                    isVerifyR1693,
                    "For requirement MS-FSSHTTPB_R1693, the SubResponseData should not be NULL.");

                // If the above logic is right, MS-FSSHTTP_R1693 can be captured.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    1693,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""GetDocMetaInfo"".");

                // If the value of element "SubResponseData" in the sub-response is not null, then capture MS-FSSHTTP_R1800.
                site.CaptureRequirementIfIsNotNull(
                    getDocMetaInfoSubResponse.SubResponseData,
                    "MS-FSSHTTP",
                    1800,
                    @"[In GetDocMetaInfoSubResponseType] [In GetDocMetaInfoSubResponseType] As part of processing the GetDocMetaInfo subrequest, the SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the following condition is true:
                         The ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"".");
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2013
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2013,
                @"[In GetDocMetaInfo Subrequest] The GetDocMetaInfoPropertySetType elements have one Property element per metadata item of type GetDocMetaInfoPropertyType as defined in section 2.3.1.29.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1685
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1685,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] GetDocMetaInfoSubResponseDataType: Type definition for Get Doc Meta Info subresponse data.");
        }