/// <summary>
        /// Capture requirements related with AmIAloneSubResponseDataType
        /// </summary>
        /// <param name="amIAloneSubResponseData">The AmIAloneSubResponseData information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateAmIAloneSubResponseDataType(AmIAloneSubResponseDataType amIAloneSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2369
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2369,
                @"[AmIAlone Subrequest]The AmIAloneSubResponseDataType defines the type of the SubResponseData element inside the AmIAloneSubResponse element. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R224811
            site.CaptureRequirement(
                "MS-FSSHTTP",
                224811,
                @"[In AmIAloneSubResponseDataType]	
<xs:complexType name=""AmIAloneSubResponseDataType"" >
    < xs:attribute name = ""AmIAlone"" type = ""tns:TRUEFALSE"" use = ""optional"" />
</ xs:complexType > ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2134
            // The SubResponseData of AmIAloneSubResponse is of type AmIAloneSubResponseDataType, so if amIAloneSubResponse.SubResponseData is not null, then MS-FSSHTTP_R2134 can be captured.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(AmIAloneSubResponseDataType),
                amIAloneSubResponseData.GetType(),
                "MS-FSSHTTP",
                2134,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table]AmIAloneSubResponseDataType:Type definition for Am I Alone subresponse data.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2371
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(AmIAloneSubResponseDataType),
                amIAloneSubResponseData.GetType(),
                "MS-FSSHTTP",
                2371,
                @"[AmIAlone Subrequest]The protocol server sends the requested information as AmIAlone attribute in the AmIAlone SubResponseData element. ");
        }
Esempio n. 2
0
        /// <summary>
        /// This method is used to test Cell Knowledge 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 VerifyCellKnowledge(CellKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Cell Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type CellKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R372, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                372,
                @"[In Cell Knowledge] Cell Knowledge Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies a cell knowledge start.");

            if (instance.CellKnowledgeEntryList != null && instance.CellKnowledgeEntryList.Count != 0)
            {
                // Directly capture requirement MS-FSSHTTPB_R373, if there are no parsing errors.
                site.CaptureRequirement(
                    "MS-FSSHTTPB",
                    373,
                    @"[In Cell Knowledge] Cell Knowledge Data (variable): A cell knowledge entry (section 2.2.1.13.2.2) that specifies one data element knowledge reference.");
            }
            else if (instance.CellKnowledgeRangeList != null && instance.CellKnowledgeRangeList.Count != 0)
            {
                // Directly capture requirement MS-FSSHTTPB_R3731, if there are no parsing errors.
                site.CaptureRequirement(
                    "MS-FSSHTTPB",
                    3731,
                    @"[In Cell Knowledge] Cell Knowledge Data (variable): A cell knowledge range (section 2.2.1.13.2.1) that specifies one or more data element knowledge references.");
            }
            else
            {
                site.Log.Add(LogEntryKind.Debug, "The CellKnowledgeEntryList and CellKnowledgeRangeList are same null or empty list in the same time.");
            }

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

            // Capture requirement MS-FSSHTTPB_R374, if the stream object end header is StreamObjectHeaderEnd8bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd8bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                374,
                @"[In Cell Knowledge] Cell Knowledge End (1 byte): An 8-bit stream object header (section 2.2.1.5.3) that specifies the cell knowledge end.");
        }
        /// <summary>
        /// Capture requirements related to EditorsTable sub response.
        /// </summary>
        /// <param name="editorsTableSubResponse">Containing the EditorsTableSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateEditorsTableSubResponse(EditorsTableSubResponseType editorsTableSubResponse, ITestSite site)
        {
            ValidateSubResponseType(editorsTableSubResponse as SubResponseType, site);

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

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

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3079
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     3079,
                     @"[In EditorsTableSubResponseType] SubResponseData: It MUST be an empty element without any attributes.");
        }
Esempio n. 4
0
        /// <summary>
        /// Capture requirements related to EditorsTable sub response.
        /// </summary>
        /// <param name="editorsTableSubResponse">Containing the EditorsTableSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateEditorsTableSubResponse(EditorsTableSubResponseType editorsTableSubResponse, ITestSite site)
        {
            ValidateSubResponseType(editorsTableSubResponse as SubResponseType, site);

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

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

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3079
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                3079,
                @"[In EditorsTableSubResponseType] SubResponseData: It MUST be an empty element without any attributes.");
        }
Esempio n. 5
0
        /// <summary>
        /// This method is used to test Content Tag Knowledge 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 VerifyContentTagKnowledge(ContentTagKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Content Tag Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type ContentTagKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R381, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                381,
                @"[In Content Tag Knowledge] Content Tag Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies the content tag knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R382, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                382,
                @"[In Content Tag Knowledge] Content Tag Entry Array (variable): An array of content tag knowledge entries (section 2.2.1.13.5.1) that specifies the BLOB heap entries.");

            // Directly capture requirement MS-FSSHTTPB_R383, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                383,
                @"[In Content Tag Knowledge] Content Tag Knowledge End (1 byte): An 8-bit stream object header (section 2.2.1.5.3) that specifies the content tag knowledge end.");

            // Verify the stream object header end related requirements.
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);
        }
        /// <summary>
        /// Capture requirements related with CellSubResponseDataType.
        /// </summary>
        /// <param name="cellSubResponseData">The cellSubResponseData</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateCellSubResponseDataType(CellSubResponseDataType cellSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1391
            // The SubResponseData of CellSubResponse is of type CellSubResponseDataType, so if cellSubResponse.SubResponseData is not null, then MS-FSSHTTP_R1391 can be captured.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(CellSubResponseDataType),
                cellSubResponseData.GetType(),
                "MS-FSSHTTP",
                1391,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] CellSubResponseDataType: Type definition for cell subresponse data.");

            if (cellSubResponseData.LockTypeSpecified)
            {
                // Verified LockTypes
                ValidateLockTypes(site);
            }

            // Verify requirements related with CellSubResponseDataOptionalAttributes
            if (cellSubResponseData.Etag != null ||
                cellSubResponseData.LastModifiedTime != null ||
                cellSubResponseData.CreateTime != null ||
                cellSubResponseData.ModifiedBy != null ||
                cellSubResponseData.CoalesceErrorMessage != null)
            {
                ValidateCellSubResponseDataOptionalAttributes(cellSubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with SchemaLockSubResponseDataType.
        /// </summary>
        /// <param name="schemaLockSubResponseData">The SchemaLockSubResponseDataType</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateSchemaLockSubResponseDataType(SchemaLockSubResponseDataType schemaLockSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1136
            // if can launch this method, the schema matches
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(SchemaLockSubResponseDataType),
                schemaLockSubResponseData.GetType(),
                "MS-FSSHTTP",
                1136,
                @"[In SchemaLock Subrequest] The SubResponseData element returned for a schema lock subrequest is of type SchemaLockSubResponseDataType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1394
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1394,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] SchemaLockSubResponseDataType: Type definition for schema lock subresponse data.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1132
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1132,
                @"[In SchemaLock Subrequest] The SchemaLockSubResponseDataType defines the type of the SubResponseData element inside the schema lock SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R726
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                726,
                @"[In SchemaLockSubResponseType] SubResponseData: A SchemaLockSubResponseDataType that specifies schema lock-related information provided by the protocol server that was requested as part of the schema lock subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R709
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                709,
                @"[In SchemaLockSubResponseDataType][SchemaLockSubResponseDataType schema is:]
                     <xs:complexType name=""SchemaLockSubResponseDataType"">
                         <xs:attribute name=""LockType"" type=""tns:LockTypes"" use=""optional"" />
                         <xs:attribute name=""ExclusiveLockReturnReason"" type=""tns:ExclusiveLockReturnReasonTypes"" use=""optional"" />
                     </xs:complexType>");

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

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1135
                // if can launch this method, the schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    1135,
                    @"[In SchemaLock Subrequest] The lock type is sent as the LockType attribute in the schema lock SubResponseData element.");
            }

            if (schemaLockSubResponseData.ExclusiveLockReturnReasonSpecified)
            {
                ValidateExclusiveLockReturnReasonTypes(site);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// This method is used to test Cell Knowledge Entry 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 VerifyCellKnowledgeEntry(CellKnowledgeEntry instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Cell Knowledge Entry related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type CellKnowledgeEntry is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R560, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                560,
                @"[In Cell Knowledge Entry] Cell Knowledge Entry (2 bytes): A 16-bit stream object header (section 2.2.1.5.1), that specifies a cell knowledge entry.");

            // Directly capture requirement MS-FSSHTTPB_R561, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                561,
                @"[In Cell Knowledge Entry] Serial Number (variable): A serial number (section 2.2.1.9) that specifies the cell.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
Esempio n. 9
0
        /// <summary>
        /// This method is used to test Content Tag Knowledge Entry 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 VerifyContentTagKnowledgeEntry(ContentTagKnowledgeEntry instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Content Tag Knowledge Entry related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type ContentTagKnowledgeEntry is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R385, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                385,
                @"[In Content Tag Knowledge Entry] Content Tag Entry Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies the start of a content tag entry.");

            // Directly capture requirement MS-FSSHTTPB_R386, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                386,
                @"[In Content Tag Knowledge Entry] BLOB Heap Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies the BLOB heap this content tag is for.");

            // Directly capture requirement MS-FSSHTTPB_R387, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                387,
                @"[In Content Tag Knowledge Entry] Clock Data (variable): A binary item (section 2.2.1.3) that specifies changes when the contents of the BLOB heap change on the server.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
        /// <summary>
        /// Capture requirements related with FileOperation Sub-request.
        /// </summary>
        /// <param name="fileOperationSubResponse">Containing the FileOperationSubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateFileOperationSubResponse(FileOperationSubResponseType fileOperationSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R11124
            site.CaptureRequirement(
                "MS-FSSHTTP",
                11124,
                @"[In FileOperationSubResponseType]  
 <xs:complexType name=""FileOperationSubResponseType"">
   <xs:complexContent>
     <xs:extension base=""tns:SubResponseType"">
        <xs:sequence minOccurs=""0"" maxOccurs=""1"">
       < xs:element name = ""SubResponseData"" />
       </ xs:sequence >

     </ xs:extension>
   </xs:complexContent>
 </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2349
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(FileOperationSubResponseType),
                fileOperationSubResponse.GetType(),
                "MS-FSSHTTP",
                2349,
                @"[FileOperation SubRequest]The protocol server responds with a FileOperation SubResponse message, which is of type FileOperationSubResponseType as specified in section 2.3.1.35. ");
        }
        /// <summary>
        /// Capture requirements related with WhoAmISubResponseDataType
        /// </summary>
        /// <param name="whoamiSubResponseData">The WhoAmISubResponseData information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateWhoAmISubResponseDataType(WhoAmISubResponseDataType whoamiSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R757
            site.CaptureRequirement(
                "MS-FSSHTTP",
                757,
                @"[In WhoAmISubResponseDataType][WhoAmISubResponseDataType schema is:]
                     <xs:complexType name=""WhoAmISubResponseDataType"">
                     <xs:attributeGroup ref=""tns:WhoAmISubResponseDataOptionalAttributes""/>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1396
            // The SubResponseData of WhoamiSubResponse is of type WhoAmISubResponseDataType, so if whoamiSubResponse.SubResponseData is not null, then MS-FSSHTTP_R1396 can be captured.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(WhoAmISubResponseDataType),
                whoamiSubResponseData.GetType(),
                "MS-FSSHTTP",
                1396,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] WhoAmISubResponseDataType: Type definition for Who Am I subresponse data.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1322
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(WhoAmISubResponseDataType),
                whoamiSubResponseData.GetType(),
                "MS-FSSHTTP",
                1322,
                @"[In WhoAmI Subrequest] The WhoAmISubResponseDataType defines the type of the SubResponseData element inside the WhoAmI SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1543
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1543,
                @"[In WhoAmISubResponseDataOptionalAttributes][UserLoginType] The UserLogin attribute MUST be specified in a WhoAmI subresponse that is generated in response to a WhoAmI subrequest.");

            if (whoamiSubResponseData.UserName != null ||
                whoamiSubResponseData.UserEmailAddress != null ||
                whoamiSubResponseData.UserSIPAddress != null)
            {
                // Verify requirements related with WhoAmISubResponseDataOptionalAttributes
                ValidateWhoAmISubResponseDataOptionalAttributes(whoamiSubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with RequestToken within Response element
        /// </summary>
        /// <param name="response">The Response information</param>
        /// <param name="expectedToken">The expected RequestToken</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateResponseToken(Response response, string expectedToken, ITestSite site)
        {
            if (expectedToken == null)
            {
                // When the expected token is null, then indicating there is no expected token value returned by server.
                return;
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R65
            site.CaptureRequirementIfAreEqual<string>(
                     expectedToken,
                     response.RequestToken,
                     "MS-FSSHTTP",
                     65,
                     @"[In Request] The one-to-one mapping between the Response element and the Request element MUST be maintained by using RequestToken.");

            // Directly capture requirement MS-FSSHTTPB_R70, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     70,
                     @"[In Request] Depending on the other types of errors[GenericErrorCodeTypes, CellRequestErrorCodeTypes, DependencyCheckRelatedErrorCodeTypes, LockAndCoauthRelatedErrorCodeTypes and NewEditorsTableCategoryErrorCodeTypes], the error code for that type MUST be returned by the protocol server.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R929
            site.CaptureRequirementIfAreEqual<string>(
                     expectedToken,
                     response.RequestToken,
                     "MS-FSSHTTP",
                     929,
                     @"[In Common Message Processing Rules and Events][The protocol server MUST follow the following common processing rules for all types of subrequests] The protocol server sends a Response element for each Request element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R95
            site.CaptureRequirementIfAreEqual<string>(
                     expectedToken,
                     response.RequestToken,
                     "MS-FSSHTTP",
                     95,
                     @"[In Response] For each Request element that is part of a cell storage service request, there MUST be a corresponding Response element in a cell storage service response.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R105
            site.CaptureRequirementIfAreEqual<string>(
                     expectedToken,
                     response.RequestToken,
                     "MS-FSSHTTP",
                     105,
                     @"[In Response] RequestToken: A nonnegative integer that specifies the request token that uniquely identifies the Request element whose response is being generated.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R108
            site.CaptureRequirementIfAreEqual<string>(
                     expectedToken,
                     response.RequestToken,
                     "MS-FSSHTTP",
                     108,
                     @"[In Response] The one-to-one mapping between the Response element and the Request element MUST be maintained by using the request token.");
        }
Esempio n. 13
0
        /// <summary>
        /// This method is used to test Version Token Knowledge 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 VerifyVersionTokenKnowledge(VersionTokenKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Version Token Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type VersionTokenKnowledge is null due to parsing error or type casting error.");
            }

            // Verify MS-FSSHTTPB requirement: MS-FSSHTTPB_R1345
            if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1345, site))
            {
                // Capture requirement MS-FSSHTTPB_R1345, if instance type is VersionTokenKnowledge.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(VersionTokenKnowledge),
                    instance.GetType(),
                    "MS-FSSHTTPB",
                    1345,
                    @"[In Appendix A: Product Behavior]Implementation does support the Version Token Knowledge(SharePoint Server 2016 and above follow this behavior.)");

                // Capture requirement MS-FSSHTTPB_R1214, if stream object start type is StreamObjectHeaderStart32bit.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(StreamObjectHeaderStart32bit),
                    instance.StreamObjectHeaderStart.GetType(),
                    "MS-FSSHTTPB",
                    1214,
                    @"[In Version Token Knowledge]Version Token Knowledge (4 bytes): A 32-bit Stream Object Header (section 2.2.1.5.2) that specifies a Version Token Knowledge.");

                // Capture requirement MS-FSSHTTPB_R1215, if TokenData type is BinaryItem.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(BinaryItem),
                    instance.TokenData.GetType(),
                    "MS-FSSHTTPB",
                    1215,
                    @"[In Version Token Knowledge]Token Data (variable): A byte stream that specifies the version token opaque to this protocol.");

                // Verify the stream object header related requirements.
                this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);
                this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
            }
        }
        /// <summary>
        /// Capture requirements related with ServerTimeSubResponseDataType.
        /// </summary>
        /// <param name="serverSubResponseData">The ServerTimeSubResponseData</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateServerTimeSubResponseDataType(ServerTimeSubResponseDataType serverSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R736
            site.CaptureRequirement(
                "MS-FSSHTTP",
                736,
                @"[In ServerTimeSubResponseDataType][ServerTimeSubResponseDataType schema is:]
                     <xs:complexType name=""ServerTimeSubResponseDataType"">
                         < xs:attribute name = ""ServerTime"" type = ""xs:positiveInteger"" use = ""optional"" />
                     </ xs:complexType > ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R740
            site.CaptureRequirement(
                "MS-FSSHTTP",
                740,
                @"[In ServerTimeSubResponseDataType] If the request for server time information from the server is successful, the ServerTime attribute MUST be specified in a server time subresponse that is generated in response to a server time subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R466
            site.CaptureRequirement(
                "MS-FSSHTTP",
                466,
                @"[In SubResponseDataOptionalAttributes] The ServerTime attribute MUST be specified in a server time subresponse that is generated in response to a server time subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1337
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(ServerTimeSubResponseDataType),
                serverSubResponseData.GetType(),
                "MS-FSSHTTP",
                1337,
                @"[In ServerTime Subrequest] The ServerTimeSubResponseDataType defines the type of the SubResponseData element that is sent in a server time SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1395
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(ServerTimeSubResponseDataType),
                serverSubResponseData.GetType(),
                "MS-FSSHTTP",
                1395,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] ServerTimeSubResponseDataType: Type definition for server time subresponse data.");
        }
        /// <summary>
        /// Capture requirements for Type structure
        /// </summary>
        /// <param name="types">Type structure</param>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureTypesElementRequirements(string types, ITestSite site)
        {
            #region MS-PCCRD_R51
            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Types: {0}", types);

            site.CaptureRequirementIfAreEqual<string>(
                "PeerDist:PeerDistData",
                types,
                51,
                "[In Types] This element [Types] MUST be set to: PeerDist:PeerDistData.");

            #endregion
        }
        /// <summary>
        /// Capture requirements for Type structure
        /// </summary>
        /// <param name="types">Type structure</param>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureTypesElementRequirements(string types, ITestSite site)
        {
            #region MS-PCCRD_R51
            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Types: {0}", types);

            site.CaptureRequirementIfAreEqual <string>(
                "PeerDist:PeerDistData",
                types,
                51,
                "[In Types] This element [Types] MUST be set to: PeerDist:PeerDistData.");

            #endregion
        }
Esempio n. 17
0
        /// <summary>
        /// This method is used to test Fragment Knowledge 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 VerifyFragmentKnowledge(FragmentKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Fragment Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FragmentKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R563, if stream object start type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart32bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                563,
                @"[In Fragment Knowledge] Fragment Knowledge Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a fragment knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R564, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                564,
                @"[In Fragment Knowledge] Fragment Knowledge Entries (variable): One or more fragment knowledge entry (section 2.2.1.13.3.1) structures specifying the fragments which have been uploaded.");

            // Directly capture requirement MS-FSSHTTPB_R565, if the stream object end is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd16bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                565,
                @"[In Fragment Knowledge] Fragment Knowledge End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies a Fragment knowledge end.");

            // Verify the stream object header end related requirements.
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
        }
        /// <summary>
        /// This method is used to verify knowledge related requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyKnowledge(Knowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type Knowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R359, if stream object start type is StreamObjectHeaderStart16bit. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     359,
                     @"[In Knowledge] Knowledge Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies a knowledge (section 2.2.1.13) start.");

            // Directly capture requirement MS-FSSHTTPB_R360, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     360,
                     @"[In Knowledge] Specialized Knowledge (variable): Zero or more specialized knowledge structures (section 2.2.1.13.1).");

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

            // Directly capture requirement MS-FSSHTTPB_R361, if stream object end type is StreamObjectHeaderStart16bit. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd8bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     361,
                     @"[In Knowledge] Knowledge End (1 byte): An 8-bit stream object header (section 2.2.1.5.3) that specifies a knowledge end.");
        }
Esempio n. 19
0
        /// <summary>
        /// This method is used to test Waterline Knowledge 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 VerifyWaterlineKnowledge(WaterlineKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Waterline Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type WaterlineKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R572, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                572,
                @"[In Waterline Knowledge] Waterline Knowledge Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies a waterline knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R573, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                573,
                @"[In Waterline Knowledge] Waterline Knowledge Data (variable): One or more waterline knowledge entries (section 2.2.1.13.4.1) that specify what the server has already delivered to the client or what the client has already received from the server.");

            // Directly capture requirement MS-FSSHTTPB_R574, if the stream object end type is StreamObjectHeaderEnd8bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd8bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                574,
                @"[In Waterline Knowledge] Waterline Knowledge End (1 byte): An 8-bit stream object header (section 2.2.1.5.3) that specifies the waterline knowledge end.");

            // Verify the stream object header end related requirements.
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);
        }
Esempio n. 20
0
        /// <summary>
        /// This method is used to verify knowledge related requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyKnowledge(Knowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type Knowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R359, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                359,
                @"[In Knowledge] Knowledge Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies a knowledge (section 2.2.1.13) start.");

            // Directly capture requirement MS-FSSHTTPB_R360, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                360,
                @"[In Knowledge] Specialized Knowledge (variable): Zero or more specialized knowledge structures (section 2.2.1.13.1).");

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

            // Directly capture requirement MS-FSSHTTPB_R361, if stream object end type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd8bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                361,
                @"[In Knowledge] Knowledge End (1 byte): An 8-bit stream object header (section 2.2.1.5.3) that specifies a knowledge end.");
        }
        /// <summary>
        /// Validate the transport between the client and the hosted cahce.
        /// </summary>
        /// <param name="transProtocol">The transport protocol.</param>
        public static void ValidateTransport(string transProtocol)
        {
            // Add the debug information
            site.Log.Add(
                LogEntryKind.Debug,
                @"Verify MS-PCHC_R1:The transport protocol {0}",
                "HTTPS");

            // Capture MS-PCHC R1
            site.CaptureRequirementIfAreEqual <string>(
                "https",
                transProtocol.ToLower(),
                1,
                @"[In Transport] The Peer Content Caching and Retrieval: Hosted Cache Protocol uses 
                a client/server transport built on top of Hypertext Transfer Protocol (HTTP) over 
                Transport Layer Security (TLS) (HTTPS) [RFC2818].");
        }
Esempio n. 22
0
        /// <summary>
        /// Verify requirements about transport.
        /// </summary>
        /// <param name="protocolVersion">The HTTP protocol version.</param>
        public static void VerifyTransport(string protocolVersion)
        {
            #region MS-PCCRTP_R4

            // Add the debug information
            site.Log.Add(
                LogEntryKind.Debug,
                "Verify MS-PCCRTP_R4. Actual value of HTTP version is: {0}.",
                protocolVersion);

            // Verify MS-PCCRTP requirement: MS-PCCRTP_R4
            site.CaptureRequirementIfAreEqual <string>(
                "1.1",
                protocolVersion,
                4,
                @"[In Transport] HTTP/1.1 is the primary transport for all messages used 
                by the PeerDist content encoding.");

            #endregion
        }
Esempio n. 23
0
        /// <summary>
        /// This method is used to test Fragment Knowledge Entry 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 VerifyFragmentKnowledgeEntry(FragmentKnowledgeEntry instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Fragment Knowledge Entry related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FragmentKnowledgeEntry is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R566, if stream object start type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart32bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                566,
                @"[In Fragment Knowledge Entry] Fragment Descriptor (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a fragment knowledge entry.");

            // Directly capture requirement MS-FSSHTTPB_R567, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                567,
                @"[In Fragment Knowledge Entry] Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies the data element this fragment knowledge entry contains knowledge about.");

            // Directly capture requirement MS-FSSHTTPB_R568, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                568,
                @"[In Fragment Knowledge Entry] Data Element Size (variable): A compact unsigned 64-bit integer (section 2.2.1.1) specifying the size in bytes of the data element specified by the preceding Extended GUID.");

            // Directly capture requirement MS-FSSHTTPB_R569, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                569,
                @"[In Fragment Knowledge Entry] Data Element Chunk Reference (variable): A file chunk reference (section 2.2.1.2) specifying which part of the data element with the preceding GUID this fragment knowledge entry contains knowledge about.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
Esempio n. 24
0
        /// <summary>
        /// This method is used to test Cell Knowledge Range 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 VerifyCellKnowledgeRange(CellKnowledgeRange instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Cell Knowledge Range related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type CellKnowledgeRange is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R376, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                376,
                @"[In Cell Knowledge Range] Cell Knowledge Range (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies the start of a cell knowledge range.");

            // Directly capture requirement MS-FSSHTTPB_R377, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                377,
                @"[In Cell Knowledge Range] GUID (16 bytes): A GUID that specifies the data element.");

            // Directly capture requirement MS-FSSHTTPB_R378, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                378,
                @"[In Cell Knowledge Range] From (variable): A compact unsigned 64-bit integer section 2.2.1.1() that specifies the starting sequence number.");

            // Directly capture requirement MS-FSSHTTPB_R558, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                558,
                @"[In Cell Knowledge Range] To (variable): A compact unsigned 64-bit integer that specifies the ending sequence number.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
Esempio n. 25
0
        /// <summary>
        /// This method is used to test Waterline Knowledge Entry 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 VerifyWaterlineKnowledgeEntry(WaterlineKnowledgeEntry instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Waterline Knowledge Entry related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type WaterlineKnowledgeEntry is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R575, if stream object start type is StreamObjectHeaderStart16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart16bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                575,
                @"[In Waterline Knowledge Entry] Waterline Knowledge Entry (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies a waterline knowledge entry.");

            // Directly capture requirement MS-FSSHTTPB_R576, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                576,
                @"[In Waterline Knowledge Entry] Cell Storage Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies the cell storage this entry specifies the waterline for.");

            // Directly capture requirement MS-FSSHTTPB_R577, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                577,
                @"[In Waterline Knowledge Entry] Waterline (variable): A compact unsigned 64-bit integer (section 2.2.1.1) that specifies a sequential serial number (section 2.2.1.9).");

            // Directly capture requirement MS-FSSHTTPB_R379, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                379,
                @"[In Waterline Knowledge Entry] Reserved (variable): A compact unsigned 64-bit integer that specifies a reserved field that MUST have value of zero.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
        /// <summary>
        /// Capture requirements related with AmIAloneSubResponseDataType
        /// </summary>
        /// <param name="amIAloneSubResponseData">The AmIAloneSubResponseData information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidatePropertiesSubResponseDataType(PropertiesSubResponseDataType propertiesSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2399
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2399,
                @"[Properties Subrequest][This is done as follows:]The PropertiesSubRequestDataType defines the type of the SubResponseData element inside the versioning SubResponse element. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2295
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2295,
                @"[PropertiesSubResponseDataType]
	<xs:complexType name=""PropertiesSubResponseDataType"">
	  <xs:sequence>
	    <xs:element name=""PropertyIds"" minOccurs=""0"" maxOccurs=""1"" type=""tns:PropertyIdsType""/>
	    <xs:element name=""PropertyValues"" minOccurs=""0"" maxOccurs=""1"" type=""tns:PropertyValuesType""/>
	  </xs:sequence>
	</xs:complexType>"    );

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2136
            // The SubResponseData of PropertiesSubResponse is of type PropertiesSubResponseDataType, so if propertiesSubResponse.SubResponseData is not null, then MS-FSSHTTP_R2136 can be captured.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(PropertiesSubResponseDataType),
                propertiesSubResponseData.GetType(),
                "MS-FSSHTTP",
                2136,
                @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table]PropertiesSubResponseDataType:Type definition for Properties subresponse data.");

            if (propertiesSubResponseData.PropertyValues != null)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2298
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2298,
                    @"[PropertiesSubResponseDataType]PropertyValues: An element of type PropertyValuesType (section 2.3.1.58) that specifies the property values.");
            }
        }
        /// <summary>
        /// This method is used to test HRESULT Error 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 VerifyHRESULTError(HRESULTError instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the HRESULT Error related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type HRESULTError 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_R772, if the header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     772,
                     @"[In HRESULT Error] Error HRESULT (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies an Error HRESULT.");

            // Directly capture requirement MS-FSSHTTPB_R773, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     773,
                     @"[In HRESULT Error] Error Code (4 bytes): An unsigned integer that specifies the HRESULT error code.");

            // Verify the compound related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }
        /// <summary>
        /// This method is used to test Response Error 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 VerifyResponseError(ResponseError instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Response Error related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type ResponseError 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_R617, if the stream object header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     617,
                     @"[In Response Error] Error Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies an error start.");

            // Directly capture requirement MS-FSSHTTPB_R618, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     618,
                     @"[In Response Error] Error Type GUID (16 bytes): A GUID that specifies the error type.");

            bool responseErrorFlag = instance.ErrorTypeGUID == new Guid(ResponseError.CellErrorGuid)
                                   || instance.ErrorTypeGUID == new Guid(ResponseError.ProtocolErrorGuid)
                                   || instance.ErrorTypeGUID == new Guid(ResponseError.Win32ErrorGuid)
                                   || instance.ErrorTypeGUID == new Guid(ResponseError.HresultErrorGuid);

            site.Assert.IsTrue(
                        responseErrorFlag,
                        "Actual the error type guid {0}, which should be either 5A66A756-87CE-4290-A38B-C61C5BA05A67,7AFEAEBF-033D-4828-9C31-3977AFE58249, 32C39011-6E39-46C4-AB78-DB41929D679E or 8454C8F2-E401-405A-A198-A10B6991B56E for requirement MS-FSSHTTPB_R619",
                        instance.ErrorTypeGUID.ToString());

            // Directly capture requirement MS-FSSHTTPB_R619, if the responseErrorFlag is true;
            site.CaptureRequirementIfIsTrue(
                     responseErrorFlag,
                     "MS-FSSHTTPB",
                     619,
                     @"[In Response Error] Error Type GUID (16 bytes): The following table contains the possible values for the error type: [the value of the Error Type GUID field must be {5A66A756-87CE-4290-A38B-C61C5BA05A67},{7AFEAEBF-033D-4828-9C31-3977AFE58249}, {32C39011-6E39-46C4-AB78-DB41929D679E}, {8454C8F2-E401-405A-A198-A10B6991B56E}.");

            switch (instance.ErrorTypeGUID.ToString("D").ToUpper(CultureInfo.CurrentCulture))
            {
                case ResponseError.CellErrorGuid:

                    // Capture requirement MS-FSSHTTPB_R620, if the error data type is CellError. 
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(CellError),
                             instance.ErrorData.GetType(),
                             "MS-FSSHTTPB",
                             620,
                             @"[In Response Error] Error Type GUID field is set to {5A66A756-87CE-4290-A38B-C61C5BA05A67}[ specifies the error type is ]Cell error (section 2.2.3.2.1).");

                    break;

                case ResponseError.ProtocolErrorGuid:

                    // All the serial number null values related requirements can be located here.
                    site.Log.Add(LogEntryKind.Debug, "Runs for ProtocolErrorGuid verification logic with the error code {0}.", instance.ErrorData.ErrorDetail);
                    break;

                case ResponseError.Win32ErrorGuid:

                    // Capture requirement MS-FSSHTTPB_R622, if the error data type is Win32 error. 
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(Win32Error),
                             instance.ErrorData.GetType(),
                             "MS-FSSHTTPB",
                             622,
                             @"[In Response Error] Error Type GUID field is set to {32C39011-6E39-46C4-AB78-DB41929D679E}[ specifies the error type is ]Win32 error (section 2.2.3.2.3).");

                    break;

                case ResponseError.HresultErrorGuid:

                    // Capture requirement MS-FSSHTTPB_R623, if the error data type is HRESULTError.  
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(HRESULTError),
                             instance.ErrorData.GetType(),
                             "MS-FSSHTTPB",
                             623,
                             @"[In Response Error] Error Type GUID field is set to {8454C8F2-E401-405A-A198-A10B6991B56E}[ specifies the error type is ]HRESULT error (section 2.2.3.2.4).");

                    break;

                default:
                    site.Assert.Fail("Unsupported error type GUID " + instance.ErrorTypeGUID.ToString());
                    break;
            }

            // Directly capture requirement MS-FSSHTTPB_R625, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     625,
                     @"[In Response Error] Error Data (variable): A structure that specifies the error data based on the Error Type GUID.");

            if (instance.ChainedError != null)
            {
                // Directly capture requirement MS-FSSHTTPB_R631, if there are no parsing errors. 
                site.CaptureRequirement(
                         "MS-FSSHTTPB",
                         631,
                         @"[In Response Error] Chained Error (variable): An optional response error that specifies the chained error information.");
            }

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

            // Directly capture requirement MS-FSSHTTPB_R632, if the stream object end is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     632,
                     @"[In Response Error] Error End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies an error end.");
        }
        /// <summary>
        /// This method is used to test Cell Error 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 VerifyCellError(CellError instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Cell Error related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type CellError 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_R634, if the header type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     634,
                     @"[In Cell Error] Error Cell (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies an error cell.");

            // Directly capture requirement MS-FSSHTTPB_R635, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     635,
                     @"[In Cell Error] Error Code (4 bytes): An unsigned integer that specifies the error code.");

            bool cellErrorFlag = (CellErrorCode)instance.ErrorCode == CellErrorCode.Unknownerror
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.InvalidObject
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Invalidpartition
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Requestnotsupported
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Storagereadonly
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.RevisionIDnotfound
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Badtoken
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Requestnotfinished
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Incompatibletoken
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Scopedcellstorage
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Coherencyfailure
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Cellstoragestatedeserializationfailure
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Incompatibleprotocolversion
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Referenceddataelementnotfound
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Requeststreamschemaerror
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Responsestreamschemaerror
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Unknownrequest
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Storagefailure
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Storagewriteonly
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Invalidserialization
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Dataelementnotfound
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Invalidimplementation
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Incompatibleoldstorage
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Incompatiblenewstorage
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.IncorrectcontextfordataelementID
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Objectgroupduplicateobjects
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Objectreferencenotfoundinrevision
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Mergecellstoragestateconflict
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Unknownquerychangesfilter
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Unsupportedquerychangesfilter
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Unabletoprovideknowledge
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.DataelementmissingID
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Dataelementmissingserialnumber
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Requestargumentinvalid
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Partialchangesnotsupported
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Storebusyretrylater
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.GUIDIDtablenotsupported
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Dataelementcycle
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Fragmentknowledgeerror
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Fragmentsizemismatch
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Fragmentsincomplete
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Fragmentinvalid
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.Abortedafterfailedputchanges
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.FailedNoUpgradeableContents
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.UnableAllocateAdditionalExtendedGuids
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.SiteReadonlyMode
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.MultiRequestPartitionReachQutoa
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.ExtendedGuidCollision
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.InsufficientPermisssions
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.ServerThrottling
                              || (CellErrorCode)instance.ErrorCode == CellErrorCode.FileTooLarge;

            site.Assert.IsTrue(
                        cellErrorFlag,
                        "The error code value for the cell error MUST be 1~47, 79, 106, 108, 111, 112, 113, 114 and 115, but except 10, 14, 17, 30");

            // Directly capture requirement MS-FSSHTTPB_R636, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     636,
                     @"[In Cell Error] Error Code (4 bytes): The following table contains the possible error codes: [the value of Error Code must be (1~47,except 10, 14, 17, 30) and 79, 106, 108, 111~115].");

            // Verify the compound related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, 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>
        /// This method is used to test WriteAccessResponse 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 VerifyWriteAccessResponse(WriteAccessResponse instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the WriteAccessResponse related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type WriteAccessResponse is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R591, if the WriteAccessResponse stream object start header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     591,
                     @"[In Query Access] Write Access Response Start (4 bytes): A 32-bit stream object header that specifies a write access response start.");

            // Directly capture requirement MS-FSSHTTPB_R592, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     592,
                     @"[In Query Access] Response Error (variable): A response error that specifies write access permission.");

            // Directly capture requirement MS-FSSHTTPB_R945, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     945,
                     @"[In Query Access] Response Error (variable): This error[Response Error] is received in response to a Put Changes request made by the client.");

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

            // Capture requirement MS-FSSHTTPB_R593, if WriteAccessResponse stream object end header is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     593,
                     @"[In Query Access] Write Access Response End (2 bytes): A 16-bit stream object header that specifies a write access response end.");
        }
        /// <summary>
        /// This method is used to verify the root node related requirements.
        /// </summary>
        /// <param name="instance">Specify the intermediate node instance.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyRootNodeObject(RootNodeObject instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the RootNodeObject related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type RootNodeObject is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPD_R37, if stream object start type is StreamObjectHeaderStart32bit. 
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     37,
                     @"[In Root Node Object Data] Root Node Start (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of  0x00, Compound of 0x1, Type of 0x20, and Length of 0x00.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R38
            site.CaptureRequirementIfAreEqual<ushort>(
                     0x104,
                     LittleEndianBitConverter.ToUInt16(instance.StreamObjectHeaderStart.SerializeToByteList().ToArray(), 0),
                     "MS-FSSHTTPD",
                     38,
                     @"[In Root Node Object Data] Root Node Start (2 bytes): The value of this field[Root Node Start] MUST be 0x0104.");

            // Directly capture requirement MS-FSSHTTPD_R38, if all above asserts pass. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.DataSize.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPD",
                     43,
                     @"[In Root Node Object Data] Data Size Header (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of  0x00, Compound of 0x0, Type of 0x22, and Length of 0x08 (the size, in bytes, of Data Size).");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8010
            site.CaptureRequirementIfAreEqual<uint>(
                     0x1110,
                     LittleEndianBitConverter.ToUInt16(instance.DataSize.StreamObjectHeaderStart.SerializeToByteList().ToArray(), 0),
                     "MS-FSSHTTPD",
                     8010,
                     @"[In Root Node Object Data] Data Size Header (2 bytes): The value of this field[Data Size Header] MUST be 0x1110.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R39
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.Signature.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPD",
                     39,
                     @"[In Root Node Object Data] Signature Header (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of 0x00, Compound of 0x0, Type of 0x21, and Length equal to the size of Signature Data.");

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

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R45
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd8bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPD",
                     45,
                     @"[In Root Node Object Data] Root Node End (1 byte): An 8-bit stream object header end, as specified in [MS-FSSHTTPB] section 2.2.1.5.3, that specifies a stream object of type 0x20.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R46
            site.CaptureRequirementIfAreEqual<byte>(
                     0x81,
                     instance.StreamObjectHeaderEnd.SerializeToByteList()[0],
                     "MS-FSSHTTPD",
                     46,
                     @"[In Root Node Object Data] Root Node End (1 byte): The value of this field[Root Node End] MUST be 0x81.");
        }
        /// <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>
        /// This method is used to test Content Tag Knowledge Entry 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 VerifyContentTagKnowledgeEntry(ContentTagKnowledgeEntry instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Content Tag Knowledge Entry related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type ContentTagKnowledgeEntry is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R385, if stream object start type is StreamObjectHeaderStart16bit. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     385,
                     @"[In Content Tag Knowledge Entry] Content Tag Entry Start (2 bytes): A 16-bit stream object header (section 2.2.1.5.1) that specifies the start of a content tag entry.");

            // Directly capture requirement MS-FSSHTTPB_R386, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     386,
                     @"[In Content Tag Knowledge Entry] BLOB Heap Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies the BLOB heap this content tag is for.");

            // Directly capture requirement MS-FSSHTTPB_R387, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     387,
                     @"[In Content Tag Knowledge Entry] Clock Data (variable): A binary item (section 2.2.1.3) that specifies changes when the contents of the BLOB heap change on the server.");

            // Verify the stream object header end related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, 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 to GetVersions sub response.
        /// </summary>
        /// <param name="getVersionsSubResponse">Containing the getVersionsSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateGetVersionsSubResponse(GetVersionsSubResponseType getVersionsSubResponse, ITestSite site)
        {
            ValidateSubResponseType(getVersionsSubResponse as SubResponseType, site);

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

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2020
            // if can launch this method, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(GetVersionsSubResponseType),
                     getVersionsSubResponse.GetType(),
                     "MS-FSSHTTP",
                     2020,
                     @"[In GetVersions Subrequest][The protocol client sends a GetVersions SubRequest message, which is of type GetVersionsSubRequestType] The protocol server responds with a GetVersions SubResponse message, which is of type GetVersionsSubResponseType as specified in section 2.3.1.32.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2026
            // if can launch this method, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2026,
                     @"[In GetVersions Subrequest] The Results element, as specified in [MS-VERSS] section 2.2.4.1, is a complex type that specifies information about the file's versions.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2301
            // If isSchemaValid is true, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2301,
                     @"[In GetVersionsSubResponseType][In Results] The DeleteAllVersions, DeleteVersion, GetVersions, and RestoreVersion methods return the Results complex type.
                     <s:complexType name=""Results"">
                       <s:sequence>
                         <s:element name=""list"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""id"" type=""s:string"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""versioning"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""enabled"" type=""s:unsignedByte"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""settings"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""url"" type=""s:string"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""result"" maxOccurs=""unbounded"" minOccurs=""1"" type=""tns:VersionData""/>
                       </s:sequence>
                     </s:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2303
            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "For requirement MS-FSSHTTP_R2303, the versioning.enabled MUST be '0' or '1', the versioning.enabled value is : {0}", getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled.ToString());

            // if can launch this method and the versioning.enabled schema matches and value must be 0 or 1.
            bool isVerifyR2303 = getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled == 0 || getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled == 1;
            site.CaptureRequirementIfIsTrue(
                     isVerifyR2303,
                     "MS-FSSHTTP",
                     2303,
                     @"[In GetVersionsSubResponseType][Results complex type] versioning.enabled: The value of this attribute [versioning.enabled] MUST be ""0"" or ""1"".");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2308
            // if can launch this method, the versioning.enabled schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2308,
                     @"[In GetVersionsSubResponseType][In VersionData] The VersionData complex type specifies the details about a single version of a file.
                     <s:complexType name=""VersionData"">
                       <s:attribute name=""version"" type=""s:string"" use=""required"" />
                       <s:attribute name=""url"" type=""s:string"" use=""required"" />
                       <s:attribute name=""created"" type=""s:string"" use=""required"" />
                       <s:attribute name=""createdRaw"" type=""s:string"" use=""required"" />  
                       <s:attribute name=""createdBy"" type=""s:string"" use=""required"" />
                       <s:attribute name=""createdByName"" type=""s:string"" use=""optional"" />
                       <s:attribute name=""size"" type=""s:unsignedLong"" use=""required"" />
                       <s:attribute name=""comments"" type=""s:string"" use=""required"" />
                     </s:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3083
            // if can launch this method, the versioning.enabled schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     3083,
                     @"[In GetVersionsResponse][The schema of GetVersionsResponse element is defined as:] 
                     <s:element name=""GetVersionsResponse"">
                       <s:complexType>
                         <s:sequence>
                           <s:element minOccurs=""1"" maxOccurs=""1"" name=""GetVersionsResult"">
                             <s:complexType>
                               <s:sequence>
                                 <s:element name=""results"" minOccurs=""1"" maxOccurs=""1"" type=""tns:Results"" />
                               </s:sequence>
                             </s:complexType>
                           </s:element>
                         </s:sequence>
                       </s:complexType>
                     </s:element>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3084
            // if can launch this method, the versioning.enabled schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     3084,
                     @"[In GetVersionsResponse] GetVersionsResult: An XML node that conforms to the structure specified in section 2.2.4.1. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2306
            // if can launch this method, the versioning.enabled schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2306,
                     @"[In GetVersionsSubResponseType][Results complex type] settings.url: Specifies the URL to the webpage of versioning-related settings for the document library in which the file resides. ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R60101
            // if can launch this method, the versioning.enabled schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     60101,
                     @"[In GetVersionsSubResponseType][VersionData] Implementation does contain the version of the file, including the major version and minor version numbers connected by period, for example, ""1.0"". (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 and above follow this behavior.)");
        }
        /// <summary>
        /// Capture requirements related to exclusive lock sub request of type, "Convert to schema lock with co-authoring transition tracked".
        /// </summary>
        /// <param name="exclusiveLockSubResponse">Containing the subResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateExclusiveLockSubResponse(ExclusiveLockSubResponseType exclusiveLockSubResponse, ITestSite site)
        {
            ValidateSubResponseType(exclusiveLockSubResponse as SubResponseType, site);

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1216
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1216,
                     @"[In ExclusiveLock Subrequest][The protocol client sends an exclusive lock SubRequest message] The protocol server responds with an exclusive lock SubResponse message, which is of type ExclusiveLockSubResponseType as specified in section 2.3.1.12.");

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

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

            if (string.Compare("Success", exclusiveLockSubResponse.ErrorCode, StringComparison.OrdinalIgnoreCase) == 0)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R264
                // if can launch this method, the schema matches
                bool isVerifyR264 = exclusiveLockSubResponse.SubResponseData != null;

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

                // If the above logic is right, MS-FSSHTTP_R264 can be captured.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         264,
                         @"[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 ""ExclusiveLock"".");
            }

            if (exclusiveLockSubResponse.SubResponseData != null)
            {
                ValidateExclusiveLockSubResponseDataType(exclusiveLockSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// This method is used to verify the requirements related with the IntermediateNodeObject type.
        /// </summary>
        /// <param name="interNode">Specify the IntermediateNodeObject instance.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyIntermediateNodeObject(IntermediateNodeObject interNode, ITestSite site)
        {
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R69
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     69,
                     @"[In Data Node Object Data] Binary data than specifies the contents of the chunk of the file that is represented by this Data Node.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R62
            site.CaptureRequirementIfAreEqual<ulong>(
                     (ulong)interNode.GetContent().Count,
                     interNode.DataSize.DataSize,
                     "MS-FSSHTTPD",
                     62,
                     @"[In Intermediate Node Object Data] Data Size (8 bytes): An unsigned 64-bit integer that specifies the size of the file data represented by this Intermediate Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R66
            site.CaptureRequirementIfAreEqual<ulong>(
                     (ulong)interNode.GetContent().Count,
                     interNode.DataSize.DataSize,
                     "MS-FSSHTTPD",
                     66,
                     @"[In Intermediate Node Object References] The size of the Data Node Object or the sum of the Data Size values from all of the Intermediate Node Objects MUST equal the Data Size specified in the Object Data of this Intermediate Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8015
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8015,
                     @"[In Intermediate Node Object References] The ordered set of Object Extended GUIDs MUST contain the Object Extended GUID of a single Data Node Object or an ordered list of Extended GUIDs for the Intermediate Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8017
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8017,
                     @"[In Intermediate Node Object References] Object Extended GUID Array entries MUST be ordered based on the sequential file bytes represented by each Node Object. ");
        }
        /// <summary>
        /// Verify ObjectGroupObjectData for the Root node object group related requirements.
        /// </summary>
        /// <param name="objectGroupObjectData">Specify the objectGroupObjectData instance.</param>
        /// <param name="rootDeclare">Specify the root declare instance.</param>
        /// <param name="objectGroupList">Specify all the ObjectGroupDataElementData list.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyObjectGroupObjectDataForRootNode(ObjectGroupObjectData objectGroupObjectData, ObjectGroupObjectDeclare rootDeclare, List<ObjectGroupDataElementData> objectGroupList, ITestSite site)
        {
            #region Verify the Object Group Object Data

            // Object Extended GUID Array : Specifies an ordered list of the Object Extended GUIDs for each child of the Root Node.
            ExGUIDArray childObjectExGuidArray = objectGroupObjectData.ObjectExGUIDArray;

            if (childObjectExGuidArray != null && childObjectExGuidArray.Count.DecodedValue != 0)
            {
                // Run here successfully, then capture the requirement MS-FSSHTTPD_R8009, MS-FSSHTTPD_R8005 and MS-FSSHTTPD_R8006.
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         8005,
                         @"[In Common Node Object Properties][Root of Object Extended GUID Array field] Specifies an ordered list of the Object Extended GUIDs for each child of the Root Node. ");

                // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8006
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         8006,
                         @"[In Common Node Object Properties][Root of Object Extended GUID Array field] Object Extended GUID Array entries MUST be ordered based on the sequential file bytes represented by each Node Object.");

                // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8009
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         8009,
                         @"[In Common Node Object Properties][Root of Object Extended GUID field] An extended GUID, as specified in [MS-FSSHTTPB] section 2.2.1.7.");

                foreach (ExGuid guid in childObjectExGuidArray.Content)
                {
                    bool isUnique = IsGuidUnique(guid, objectGroupList);
                    site.Log.Add(LogEntryKind.Debug, "Whether the Object Extended GUID is unique:{0}", isUnique);

                    // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8101
                    site.CaptureRequirementIfIsTrue(
                             isUnique,
                             "MS-FSSHTTPD",
                             8101,
                             @"[In Common Node Object Properties][Root of Object Extended GUID field] This GUID[Object Extended GUID] MUST be different within this file in once response.");
                }
            }

            // Cell ID Array : Specifies an empty list of Cell IDs.
            CellIDArray cellIDArray = objectGroupObjectData.CellIDArray;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Cell ID Array is:{0}", cellIDArray.Count);

            // If the Cell ID Array is an empty list, indicates that the count of the array is 0.
            // So capture these requirements.
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R4
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     4,
                     @"[In Common Node Object Properties][Root of Cell ID Array field] Specifies an empty list of Cell IDs.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R50
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     50,
                     @"[In Root Node Object Cell References] The Cell ID Array, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4, of the Root Node Object MUST specify an empty array.");

            #endregion 

            #region Verify the Object Group Object Declaration

            // Object Extended GUID : An extended GUID which specifies an identifier for this object. This GUID MUST be unique within this file.
            ExGuid currentObjectExGuid = rootDeclare.ObjectExtendedGUID;

            // Check whether Object Extended GUID is unique.
            bool isGuidUnique = IsGuidUnique(currentObjectExGuid, objectGroupList);

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "Whether the Object Extended GUID is unique:{0}", isGuidUnique);

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8103
            site.CaptureRequirementIfIsTrue(
                     isGuidUnique,
                     "MS-FSSHTTPD",
                     8103,
                     @"[In Common Node Object Properties][Data of Object Extended GUID field] This GUID[Object Extended GUID] MUST be different within this file in once response.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R75
            site.CaptureRequirementIfIsTrue(
                     isGuidUnique,
                     "MS-FSSHTTPD",
                     75,
                     @"[In Cell Properties] For each stream, a single Root Node MUST be specified by using a unique root identifier.");

            // Object Partition ID : A compact unsigned 64-bit integer which MUST be 1.
            Compact64bitInt objectPartitionID = rootDeclare.ObjectPartitionID;

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R17
            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectPartitionID.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(objectPartitionID.DecodedValue == 1, "The actual value of objectPartitionID should be 1.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R17
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     17,
                     @"[In Common Node Object Properties][Root of Object Partition ID field] A compact unsigned 64-bit integer that MUST be ""1"".");

            // Object Data Size :A compact unsigned 64-bit integer which MUST be the size of the Object Data field.
            Compact64bitInt objectDataSize = rootDeclare.ObjectDataSize;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Object Data Size is:{0}", objectDataSize.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectDataSize.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R20
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     20,
                     @"[In Common Node Object Properties][Root of Object Data Size field] A compact unsigned 64-bit integer that MUST be the size of the Object Data field.");

            // Object References Count : A compact unsigned 64-bit integer that specifies the number of object references.
            Compact64bitInt objectReferencesCount = rootDeclare.ObjectReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Object References is:{0}", objectReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectReferencesCount.GetType()), "The type of objectReferencesCount should be a compact unsigned 64-bit integer.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R23
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     23,
                     @"[In Common Node Object Properties][Root  of Object References Count field] A compact unsigned 64-bit integer that specifies the number of object references.");

            // Cell References Count : A compact unsigned 64-bit integer which MUST be 0.
            Compact64bitInt cellReferencesCount = rootDeclare.CellReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Cell References is:{0}", cellReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(cellReferencesCount.GetType()), "The type of cellReferencesCount should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(cellReferencesCount.DecodedValue == 0, "The value of cellReferencesCount should be 0.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R26
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     26,
                     @"[In Common Node Object Properties][Root of Cell References Count field] A compact unsigned 64-bit integer that MUST be zero.");
            #endregion

            // Run here successfully, then capture the requirement MS-FSSHTTPD_R8002 and MS-FSSHTTPD_R8004.
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8002,
                     @"[In Common Node Object Properties] A Node Object is contained within an object group data element.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8004
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8004,
                     @"[In Common Node Object Properties] The Object Group Object Data field MUST be set as shown in the following table, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4");
        }
        /// <summary>
        /// This method is used to verify the requirements related with the RootNodeObject type.
        /// </summary>
        /// <param name="rootNode">Specify the RootNodeObject instance.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyRootNodeObject(RootNodeObject rootNode, ITestSite site)
        {
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R44
            site.CaptureRequirementIfAreEqual<ulong>(
                     (ulong)rootNode.GetContent().Count,
                     rootNode.DataSize.DataSize,
                     "MS-FSSHTTPD",
                     44,
                     @"[In Root Node Object Data] Data Size (8 bytes): An unsigned 64-bit integer that specifies the size of the file data represented by this Root Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R49
            site.CaptureRequirementIfAreEqual<ulong>(
                     (ulong)rootNode.GetContent().Count,
                     rootNode.DataSize.DataSize,
                     "MS-FSSHTTPD",
                     49,
                     @"[In Root Node Object References] The sum of the Data Size values from all of the Intermediate Node Objects MUST equal the Data Size specified in the Object Data of this Root Node Object.");

            // When after build the Root node object successfully, the following requirements can be directly captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     48,
                     @"[In Root Node Object References] Each Object Extended GUID MUST specify an Intermediate Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8011
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8011,
                     @"[In Root Node Object References] The Object Extended GUID Array, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4, of the Root Node Object MUST specify an ordered set of Object Extended GUIDs. ");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8012
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8012,
                     @"[In Root Node Object References] Object Extended GUID Array entries MUST be ordered based on the sequential file bytes represented by each Node Object.");
        }
        /// <summary>
        /// Verify ObjectGroupObjectData for the DataNodeObject related requirements.
        /// </summary>
        /// <param name="objectGroupObjectData">Specify the objectGroupObjectData instance.</param>
        /// <param name="dataNodeDeclare">Specify the data node object declare instance.</param>
        /// <param name="objectGroupList">Specify all the ObjectGroupDataElementData list.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyObjectGroupObjectDataForDataNodeObject(ObjectGroupObjectData objectGroupObjectData, ObjectGroupObjectDeclare dataNodeDeclare, List<ObjectGroupDataElementData> objectGroupList, ITestSite site)
        {
            #region Verify the Object Group Object Data

            // Object Extended GUID Array : Specifies an ordered list of the Object Extended GUIDs for each child of the Root Node.
            ExGUIDArray childObjectExGuidArray = objectGroupObjectData.ObjectExGUIDArray;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Cell ID Array is:{0}", childObjectExGuidArray.Count.DecodedValue);

            // If the Object Extended GUID Array is an empty list, indicates that the count of the array is 0.
            // So capture these requirements.
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R3
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     childObjectExGuidArray.Count.DecodedValue,
                     "MS-FSSHTTPD",
                     3,
                     @"[In Common Node Object Properties][Data of Object Extended GUID Array field] Specifies an empty list of Object Extended GUIDs.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R71
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     childObjectExGuidArray.Count.DecodedValue,
                     "MS-FSSHTTPD",
                     71,
                     @"[In Data Node Object References] The Object Extended GUID Array, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4, of the Data Node Object MUST specify an empty array.");

            // Cell ID Array : Specifies an empty list of Cell IDs.
            CellIDArray cellIDArray = objectGroupObjectData.CellIDArray;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Cell ID Array is:{0}", cellIDArray.Count);

            // If the Object Extended GUID Array is an empty list, indicates that the count of the array is 0.
            // So capture these requirements.
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R6
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     6,
                     @"[In Common Node Object Properties][Data of Cell ID Array field] Specifies an empty list of Cell IDs.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R72
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     72,
                     @"[In Data Node Object Cell References] The Object Extended GUID Array, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4, of the Data Node Object MUST specify an empty array.");

            #endregion 

            #region Verify the Object Group Object Declaration

            // Object Extended GUID : An extended GUID which specifies an identifier for this object. This GUID MUST be unique within this file.
            ExGuid currentObjectExGuid = dataNodeDeclare.ObjectExtendedGUID;

            // Check whether Object Extended GUID is unique.
            bool isUnique = IsGuidUnique(currentObjectExGuid, objectGroupList);

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "Whether the Object Extended GUID is unique:{0}", isUnique);

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8103
            site.CaptureRequirementIfIsTrue(
                     isUnique,
                     "MS-FSSHTTPD",
                     8103,
                     @"[In Common Node Object Properties][Data of Object Extended GUID field] This GUID[Object Extended GUID] MUST be different within this file in once response.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8103
            site.CaptureRequirementIfIsTrue(
                     isUnique,
                     "MS-FSSHTTPD",
                     8103,
                     @"[In Common Node Object Properties][Data of Object Extended GUID field] This GUID[Object Extended GUID] MUST be different within this file in once response.");

            // Object Partition ID : A compact unsigned 64-bit integer which MUST be 1.
            Compact64bitInt objectPartitionID = dataNodeDeclare.ObjectPartitionID;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Object Partition ID is:{0}", objectPartitionID.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectPartitionID.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(objectPartitionID.DecodedValue == 1, "The actual value of objectPartitionID should be 1.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R19            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     19,
                     @"[In Common Node Object Properties][Data of Object Partition ID field] A compact unsigned 64-bit integer that MUST be ""1"".");

            // Object Data Size : A compact unsigned 64-bit integer which MUST be the size of the Object Data field.
            Compact64bitInt objectDataSize = dataNodeDeclare.ObjectDataSize;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Object Data Size is:{0}", objectDataSize.DecodedValue);

            // Get the size of Object Data.
            ulong sizeInObjectData = (ulong)objectGroupObjectData.Data.Length.DecodedValue;

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectDataSize.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(objectDataSize.DecodedValue == sizeInObjectData, "The actual value of objectDataSize should be same as the Object Data field");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R22            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     22,
                     @"[In Common Node Object Properties][Data of Object Data Size field] A compact unsigned 64-bit integer that MUST be the size of the Object Data field.");

            // Object References Count : A compact unsigned 64-bit integer that specifies the number of object references.
            Compact64bitInt objectReferencesCount = dataNodeDeclare.ObjectReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Object References is:{0}", objectReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectReferencesCount.GetType()), "The type of objectReferencesCount should be a compact unsigned 64-bit integer.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R25            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     25,
                     @"[In Common Node Object Properties][Data of Object References Count field] A compact unsigned 64-bit integer that specifies the number of object references.");

            // Cell References Count : A compact unsigned 64-bit integer which MUST be 0.
            Compact64bitInt cellReferencesCount = dataNodeDeclare.CellReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Cell References is:{0}", cellReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(cellReferencesCount.GetType()), "The type of cellReferencesCount should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(cellReferencesCount.DecodedValue == 0, "The value of cellReferencesCount should be 0.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R28            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     28,
                     @"[In Common Node Object Properties][Data of Cell References Count field] A compact unsigned 64-bit integer that MUST be zero.");

            #endregion 
        }
        /// <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 to coauthoring sub response.
        /// </summary>
        /// <param name="coauthSubResponse">The coauthoring response.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateCoauthSubResponse(CoauthSubResponseType coauthSubResponse, ITestSite site)
        {
            ValidateSubResponseType(coauthSubResponse as SubResponseType, site);

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

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

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

                // If the coauthSubResponse.SubResponseData is null, the case run fail.
                site.Assert.IsTrue(
                            isVerifyR1496,
                            "For requirement MS-FSSHTTP_R1496, the SubResponseData should not be NULL.");

                // if coauthSubResponse.SubResponseData is not null, make sure sent as part of the SubResponse element in a cell storage service response message,
                // so this requirement can be captured.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         1496,
                         @"[In CoauthSubResponseType] As part of processing the coauthoring 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"".");

                // Add the log information.
                site.Log.Add(LogEntryKind.Debug, "Verify MS-FSSHTTP_R267:the returned SubResponseData is {0}", coauthSubResponse.SubResponseData.ToString());

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R267
                // if coauthSubResponse.SubResponseData is not null, make sure sent as part of the SubResponse element in a cell storage service response message,
                // so this requirement can be captured.
                bool isVerifyR267 = coauthSubResponse.SubResponseData != null;
                site.CaptureRequirementIfIsTrue(
                         isVerifyR267,
                         "MS-FSSHTTP",
                         267,
                         @"[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 ""Coauth"".");
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R624
            // If the coauthoring subResponse exists,its schema will have been validated before invoking the method CaptureJoinCoauthoringSessionRelatedRequirements.
            // So MS-FSSHTTP_R624 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     624,
                     @"[In CoauthSubResponseType][CoauthSubResponseType schema is:]
                     <xs:complexType name=""CoauthSubResponseType"">
                       <xs:complexContent>
                         <xs:extension base=""tns:SubResponseType"">
                           <xs:sequence minOccurs=""0"" maxOccurs=""1"">
                              <xs:element name=""SubResponseData"" type=""tns:CoauthSubResponseDataType"" />
                           </xs:sequence>
                         </xs:extension>
                       </xs:complexContent>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R984
            // Since the subResponse is of type CoauthSubResponseType, so this requirement can be captured.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(CoauthSubResponseType),
                     coauthSubResponse.GetType(),
                     "MS-FSSHTTP",
                     984,
                     @"[In Coauth Subrequest][The protocol client sends a coauthoring SubRequest message, which is of type CoauthSubRequestType,] The protocol server responds with a coauthoring SubResponse message, which is of type CoauthSubResponseType as specified in section 2.3.1.8.");

            if (coauthSubResponse.SubResponseData != null)
            {
                ValidateCoauthSubResponseDataType(coauthSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with SchemaLockSubResponseDataType.
        /// </summary>
        /// <param name="schemaLockSubResponseData">The SchemaLockSubResponseDataType</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateSchemaLockSubResponseDataType(SchemaLockSubResponseDataType schemaLockSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1136
            // if can launch this method, the schema matches
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(SchemaLockSubResponseDataType),
                     schemaLockSubResponseData.GetType(),
                     "MS-FSSHTTP",
                     1136,
                     @"[In SchemaLock Subrequest] The SubResponseData element returned for a schema lock subrequest is of type SchemaLockSubResponseDataType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1394
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1394,
                     @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] SchemaLockSubResponseDataType: Type definition for schema lock subresponse data.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1132
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1132,
                     @"[In SchemaLock Subrequest] The SchemaLockSubResponseDataType defines the type of the SubResponseData element inside the schema lock SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R726
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     726,
                     @"[In SchemaLockSubResponseType] SubResponseData: A SchemaLockSubResponseDataType that specifies schema lock-related information provided by the protocol server that was requested as part of the schema lock subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R709
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     709,
                     @"[In SchemaLockSubResponseDataType][SchemaLockSubResponseDataType schema is:]
                     <xs:complexType name=""SchemaLockSubResponseDataType"">
                         <xs:attribute name=""LockType"" type=""tns:LockTypes"" use=""optional"" />
                         <xs:attribute name=""ExclusiveLockReturnReason"" type=""tns:ExclusiveLockReturnReasonTypes"" use=""optional"" />
                     </xs:complexType>");

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

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1135
                // if can launch this method, the schema matches.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         1135,
                         @"[In SchemaLock Subrequest] The lock type is sent as the LockType attribute in the schema lock SubResponseData element.");
            }

            if (schemaLockSubResponseData.ExclusiveLockReturnReasonSpecified)
            {
                ValidateExclusiveLockReturnReasonTypes(site);
            }
        }
        /// <summary>
        /// This method is used to verify the intermediate node related requirements.
        /// </summary>
        /// <param name="instance">Specify the intermediate node instance.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyIntermediateNodeObject(IntermediateNodeObject instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the IntermediateNodeObject related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type IntermediateNodeObject is null due to parsing error or type casting error.");
            }

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

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R55
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPD",
                     55,
                     @"[In Intermediate Node Object Data] Intermediate Node Start (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of 0x00, Compound of 0x1, Type of 0x1F, and Length of 0x00.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R56
            site.CaptureRequirementIfAreEqual<ushort>(
                     0xFC,
                     LittleEndianBitConverter.ToUInt16(instance.StreamObjectHeaderStart.SerializeToByteList().ToArray(), 0),
                     "MS-FSSHTTPD",
                     56,
                     @"[In Intermediate Node Object Data] Intermediate Node Start (2 bytes): The value of this field[Intermediate Node Start] MUST be 0x00FC.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R57
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.Signature.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPD",
                     57,
                     @"[In Intermediate Node Object Data] Signature Header (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of  0x00, Compound of 0x0, Type of 0x21, and Length equal to the size of Signature Data.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R61
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart16bit),
                     instance.DataSize.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPD",
                     61,
                     @"[In Intermediate Node Object Data] Data Size Header (2 bytes): A 16-bit stream object header, as specified in [MS-FSSHTTPB] section 2.2.1.5.1, with a Header Type of  0x00, Compound of 0x0, Type of 0x22, and Length of 0x08 (the size, in bytes, of Data Size).");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8013
            site.CaptureRequirementIfAreEqual<uint>(
                     0x1110,
                     LittleEndianBitConverter.ToUInt16(instance.DataSize.StreamObjectHeaderStart.SerializeToByteList().ToArray(), 0),
                     "MS-FSSHTTPD",
                     8013,
                     @"[In Intermediate Node Object Data] Data Size Header (2 bytes): The value of this field[Data Size Header] MUST be 0x1110.");

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

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R63
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd8bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPD",
                     63,
                     @"[In Intermediate Node Object Data] Intermediate Node End (1 byte): An 8-bit stream object header end, as specified in [MS-FSSHTTPB] section 2.2.1.5.3, that specifies a stream object of type 0x1F.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8014
            site.CaptureRequirementIfAreEqual<byte>(
                     0x7D,
                     instance.StreamObjectHeaderEnd.SerializeToByteList()[0],
                     "MS-FSSHTTPD",
                     8014,
                     @"[In Intermediate Node Object Data] Intermediate Node End (1 byte):The value of this field[Intermediate Node End] MUST be 0x7D.");
        }
Esempio n. 46
0
        /// <summary>
        /// This method is used to test Specialized Knowledge 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 VerifySpecializedKnowledge(SpecializedKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Specialized Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type SpecializedKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R362, if stream object start type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart32bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                362,
                @"[In Specialized Knowledge] Specialized Knowledge Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies A specialized knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R363, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                363,
                @"[In Specialized Knowledge] GUID (16 bytes): A GUID that specifies the type of specialized knowledge.");

            bool isVerifyR364 = instance.GUID == SpecializedKnowledge.CellKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.ContentTagKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.WaterlineKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.FragmentKnowledgeGuid;

            site.Log.Add(
                LogEntryKind.Debug,
                "Actual GUID value {0}, expect the value either 327A35F6-0761-4414-9686-51E900667A4D, 3A76E90E-8032-4D0C-B9DD-F3C65029433E, 0ABE4F35-01DF-4134-A24A-7C79F0859844 or 10091F13-C882-40FB-9886-6533F934C21D for MS-FSSHTTPB_R364.",
                instance.GUID.ToString());

            // Capture requirement MS-FSSHTTPB_R364, if the GUID equals the mentioned four values {327A35F6-0761-4414-9686-51E900667A4D}, {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, {0ABE4F35-01DF-4134-A24A-7C79F0859844}, {10091F13-C882-40FB-9886-6533F934C21D}.
            site.CaptureRequirementIfIsTrue(
                isVerifyR364,
                "MS-FSSHTTPB",
                364,
                @"[In Specialized Knowledge] The following GUIDs detail the type of knowledge contained: [Its value must be one of] {327A35F6-0761-4414-9686-51E900667A4D}, {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, {0ABE4F35-01DF-4134-A24A-7C79F0859844}, {10091F13-C882-40FB-9886-6533F934C21D}].");

            switch (instance.GUID.ToString("D").ToUpper(CultureInfo.CurrentCulture))
            {
            case "327A35F6-0761-4414-9686-51E900667A4D":

                // Capture requirement MS-FSSHTTPB_R365, if the knowledge data type is CellKnowledge.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(CellKnowledge),
                    instance.SpecializedKnowledgeData.GetType(),
                    "MS-FSSHTTPB",
                    365,
                    @"[In Specialized Knowledge][If the GUID field is set to ] {327A35F6-0761-4414-9686-51E900667A4D}, [it indicates the type of the specialized knowledge is]Cell knowledge (section 2.2.1.13.2).");
                break;

            case "3A76E90E-8032-4D0C-B9DD-F3C65029433E":

                // Capture requirement MS-FSSHTTPB_R366, if the knowledge data type is WaterlineKnowledge.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(WaterlineKnowledge),
                    instance.SpecializedKnowledgeData.GetType(),
                    "MS-FSSHTTPB",
                    366,
                    @"[In Specialized Knowledge][If the GUID field is set to ] {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, [it indicates the type of the specialized knowledge is]Waterline knowledge (section 2.2.1.13.4).");

                break;

            case "0ABE4F35-01DF-4134-A24A-7C79F0859844":

                // Capture requirement MS-FSSHTTPB_R367, if the knowledge data type is FragmentKnowledge.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(FragmentKnowledge),
                    instance.SpecializedKnowledgeData.GetType(),
                    "MS-FSSHTTPB",
                    367,
                    @"[In Specialized Knowledge][If the GUID field is set to ] {0ABE4F35-01DF-4134-A24A-7C79F0859844}, [it indicates the type of the specialized knowledge is]Fragment knowledge (section 2.2.1.13.3).");

                break;

            case "10091F13-C882-40FB-9886-6533F934C21D":

                // Capture requirement MS-FSSHTTPB_R368, if the knowledge data type is ContentTagKnowledge.
                site.CaptureRequirementIfAreEqual <Type>(
                    typeof(ContentTagKnowledge),
                    instance.SpecializedKnowledgeData.GetType(),
                    "MS-FSSHTTPB",
                    368,
                    @"[In Specialized Knowledge][If the GUID field is set to ] {10091F13-C882-40FB-9886-6533F934C21D}, [it indicates the type of the specialized knowledge is]Content tag knowledge (section 2.2.1.13.5).");
                break;

            default:
                site.Assert.Fail("Unsupported specialized knowledge value " + instance.GUID.ToString());
                break;
            }

            // Directly capture requirement MS-FSSHTTPB_R369, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                369,
                @"[In Specialized Knowledge] Specialized Knowledge Data (variable): The data for the specific knowledge type.");

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

            // Capture requirement MS-FSSHTTPB_R370, if the stream object end type is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd16bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                370,
                @"[In Specialized Knowledge] Specialized Knowledge End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies specialized knowledge end.");
        }
        /// <summary>
        /// This method is used to test Specialized Knowledge 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 VerifySpecializedKnowledge(SpecializedKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Specialized Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type SpecializedKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R362, if stream object start type is StreamObjectHeaderStart32bit. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     362,
                     @"[In Specialized Knowledge] Specialized Knowledge Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies A specialized knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R363, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     363,
                     @"[In Specialized Knowledge] GUID (16 bytes): A GUID that specifies the type of specialized knowledge.");

            bool isVerifyR364 = instance.GUID == SpecializedKnowledge.CellKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.ContentTagKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.WaterlineKnowledgeGuid ||
                                instance.GUID == SpecializedKnowledge.FragmentKnowledgeGuid;

            site.Log.Add(
                         LogEntryKind.Debug,
                        "Actual GUID value {0}, expect the value either 327A35F6-0761-4414-9686-51E900667A4D, 3A76E90E-8032-4D0C-B9DD-F3C65029433E, 0ABE4F35-01DF-4134-A24A-7C79F0859844 or 10091F13-C882-40FB-9886-6533F934C21D for MS-FSSHTTPB_R364.",
                         instance.GUID.ToString());

            // Capture requirement MS-FSSHTTPB_R364, if the GUID equals the mentioned four values {327A35F6-0761-4414-9686-51E900667A4D}, {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, {0ABE4F35-01DF-4134-A24A-7C79F0859844}, {10091F13-C882-40FB-9886-6533F934C21D}.
            site.CaptureRequirementIfIsTrue(
                     isVerifyR364,
                     "MS-FSSHTTPB",
                     364,
                     @"[In Specialized Knowledge] The following GUIDs detail the type of knowledge contained: [Its value must be one of] {327A35F6-0761-4414-9686-51E900667A4D}, {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, {0ABE4F35-01DF-4134-A24A-7C79F0859844}, {10091F13-C882-40FB-9886-6533F934C21D}].");

            switch (instance.GUID.ToString("D").ToUpper(CultureInfo.CurrentCulture))
            {
                case "327A35F6-0761-4414-9686-51E900667A4D":

                    // Capture requirement MS-FSSHTTPB_R365, if the knowledge data type is CellKnowledge.
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(CellKnowledge),
                             instance.SpecializedKnowledgeData.GetType(),
                             "MS-FSSHTTPB",
                             365,
                             @"[In Specialized Knowledge][If the GUID field is set to ] {327A35F6-0761-4414-9686-51E900667A4D}, [it indicates the type of the specialized knowledge is]Cell knowledge (section 2.2.1.13.2).");
                    break;

                case "3A76E90E-8032-4D0C-B9DD-F3C65029433E":

                    // Capture requirement MS-FSSHTTPB_R366, if the knowledge data type is WaterlineKnowledge.
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(WaterlineKnowledge),
                             instance.SpecializedKnowledgeData.GetType(),
                             "MS-FSSHTTPB",
                             366,
                             @"[In Specialized Knowledge][If the GUID field is set to ] {3A76E90E-8032-4D0C-B9DD-F3C65029433E}, [it indicates the type of the specialized knowledge is]Waterline knowledge (section 2.2.1.13.4).");

                    break;

                case "0ABE4F35-01DF-4134-A24A-7C79F0859844":

                    // Capture requirement MS-FSSHTTPB_R367, if the knowledge data type is FragmentKnowledge.
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(FragmentKnowledge),
                             instance.SpecializedKnowledgeData.GetType(),
                             "MS-FSSHTTPB",
                             367,
                             @"[In Specialized Knowledge][If the GUID field is set to ] {0ABE4F35-01DF-4134-A24A-7C79F0859844}, [it indicates the type of the specialized knowledge is]Fragment knowledge (section 2.2.1.13.3).");

                    break;

                case "10091F13-C882-40FB-9886-6533F934C21D":

                    // Capture requirement MS-FSSHTTPB_R368, if the knowledge data type is ContentTagKnowledge.
                    site.CaptureRequirementIfAreEqual<Type>(
                             typeof(ContentTagKnowledge),
                             instance.SpecializedKnowledgeData.GetType(),
                             "MS-FSSHTTPB",
                             368,
                             @"[In Specialized Knowledge][If the GUID field is set to ] {10091F13-C882-40FB-9886-6533F934C21D}, [it indicates the type of the specialized knowledge is]Content tag knowledge (section 2.2.1.13.5).");
                    break;

                default:
                    site.Assert.Fail("Unsupported specialized knowledge value " + instance.GUID.ToString());
                    break;
            }

            // Directly capture requirement MS-FSSHTTPB_R369, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     369,
                     @"[In Specialized Knowledge] Specialized Knowledge Data (variable): The data for the specific knowledge type.");

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

            // Capture requirement MS-FSSHTTPB_R370, if the stream object end type is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     370,
                     @"[In Specialized Knowledge] Specialized Knowledge End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies specialized knowledge end.");
        }
        /// <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>
        /// This method is used to test Response Message Syntax 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 VerifyFsshttpbResponse(FsshttpbResponse instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Response Message Syntax related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FsshttpbResponse is null due to parsing error or type casting error.");
            }

            // Directly capture requirement MS-FSSHTTPB_R534, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     534,
                     @"[In Response Message Syntax]  Protocol Version (2bytes): An unsigned integer that specifies the protocol schema version number used in this request.");

            // Capture requirement MS-FSSHTTPB_R535, if the protocol version number equals to 12. 
            site.CaptureRequirementIfAreEqual<int>(
                     12,
                     instance.ProtocolVersion,
                     "MS-FSSHTTPB",
                     535,
                     @"[In Response Message Syntax] Protocol Version (2bytes): This value[Protocol Version] MUST be 12.");

            // Directly capture requirement MS-FSSHTTPB_R536, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     536,
                     @"[In Response Message Syntax] Minimum Version (2 bytes): An unsigned integer that specifies the oldest version of the protocol schema that this schema is compatible with.");

            // Capture requirement MS-FSSHTTPB_R537, if the minimum version number equals to 11. 
            site.CaptureRequirementIfAreEqual<int>(
                     11,
                     instance.MinimumVersion,
                     "MS-FSSHTTPB",
                     537,
                     @"[In Response Message Syntax] Minimum Version (2 bytes): This value[Minimum Version] MUST be 11.");

            // Directly capture requirement MS-FSSHTTPB_R538, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     538,
                     @"[In Response Message Syntax] Signature (8 bytes): An unsigned integer that specifies a constant signature, to identify this as a response.");

            // Capture requirement MS-FSSHTTPB_R539, if the signature number equals to 0x9B069439F329CF9D.
            site.CaptureRequirementIfAreEqual<ulong>(
                     0x9B069439F329CF9D,
                     instance.Signature,
                     "MS-FSSHTTPB",
                     539,
                     @"[In Response Message Syntax] Signature (8 bytes): This[Signature] MUST be set to 0x9B069439F329CF9D.");

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

            // Capture requirement MS-FSSHTTPB_R540, if the response header equals to StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.ResponseStart.GetType(),
                     "MS-FSSHTTPB",
                     540,
                     @"[In Response Message Syntax] Response Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a response start.");

            if (instance.Status == true)
            {
                site.Log.Add(
                        LogEntryKind.Debug,
                        "When the status is set, the response error value {0}.",
                        instance.ResponseError.ErrorData.ErrorDetail);
            }
            else
            {
                if (instance.DataElementPackage != null)
                {
                    // Directly capture requirement MS-FSSHTTPB_R2191, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             2191,
                             @"[In Response Message Syntax] Data Element Package (variable): An optional data element package structure (section 2.2.1.12) that specifies data elements corresponding to the sub-responses (section 2.2.3.1).");
                }

                if (instance.CellSubResponses != null && instance.CellSubResponses.Count != 0)
                {
                    // Directly capture requirement MS-FSSHTTPB_R2192, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             2192,
                             @"[In Response Message Syntax] Sub-response (variable): Specifies an array of sub-responses corresponding to the sub-requests as specified in section 2.2.2.1.");

                    // Directly capture requirement MS-FSSHTTPB_R851, if there are no parsing errors.
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             851,
                             @"[In Message Processing Events and Sequencing Rules] The server MUST reply to a well-formed request with a response, as specified in section 2.2.3, which includes a sub-response for each sub-request.");
                }

                // Directly capture requirement MS-FSSHTTPB_R2190, if there are no parsing errors.
                site.CaptureRequirement(
                         "MS-FSSHTTPB",
                         2190,
                         @"[In Response Message Syntax] Response Data (variable): If the request did not fail, the response data is specified by the following structure [Data Element Package, Sub Responses].");
            }

            // Capture requirement MS-FSSHTTPB_R543, if the reserved value equals to 0.
            site.CaptureRequirementIfAreEqual<int>(
                     0,
                     instance.Reserved,
                     "MS-FSSHTTPB",
                     543,
                     @"[In Response Message Syntax] 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.ResponseEnd, instance.GetType(), site);
            this.ExpectCompoundObject(instance.ResponseStart, site);

            // Capture requirement MS-FSSHTTPB_R546, if the response header equals to StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.ResponseEnd.GetType(),
                     "MS-FSSHTTPB",
                     546,
                     @"[In Response Message Syntax] Response End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies a response end.");
        }
        /// <summary>
        /// Capture requirements related with VersionNumberType.
        /// </summary>
        /// <param name="versionNumber">A version number</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateVersionNumberType(ushort versionNumber, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R423
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     423,
                     @"[In VersionNumberType][VersionNumberType schema is:]
                     <xs:simpleType name=""VersionNumberType"">
                         <xs:restriction base=""xs:unsignedShort"">
                           <xs:minInclusive value=""2""/>
                     <xs:maxInclusive value=""2""/>
                         </xs:restriction>
                     </xs:simpleType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R424
            site.CaptureRequirementIfAreEqual<ushort>(
                     2,
                     versionNumber,
                     "MS-FSSHTTP",
                     424,
                     @"[In VersionNumberType] The value of VersionNumberType MUST be the value that is listed in the following: [2].");

            site.CaptureRequirementIfAreEqual<ushort>(
                     2,
                     versionNumber,
                     "MS-FSSHTTP",
                     425,
                     @"[In VersionNumberType] 2 [means] a version number of 2.");
        }
        /// <summary>
        /// This method is used to test Query Changes 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 VerifyQueryChangesSubResponseData(QueryChangesSubResponseData instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Query Changes related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type QueryChangesSubResponseData is null due to parsing error or type casting error.");
            }

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

            // Directly capture requirement MS-FSSHTTPB_R595, if the stream object header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.QueryChangesResponseStart.GetType(),
                     "MS-FSSHTTPB",
                     595,
                     @"[In Query Changes] Query Changes Response (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a Query Changes response.");

            // Directly capture requirement MS-FSSHTTPB_R596, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     596,
                     @"[In Query Changes] Storage Index Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies storage index.");

            // Directly capture requirement MS-FSSHTTPB_R598, if the reserved value equals to 1. 
            site.CaptureRequirementIfAreEqual<int>(
                     0,
                     instance.ReservedQueryChanges,
                     "MS-FSSHTTPB",
                     598,
                     @"[In Query Changes] Reserved (7 bits): A 7-bit reserved field that MUST be set to zero.");

            // Directly capture requirement MS-FSSHTTPB_R601, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     601,
                     @"[In Query Changes] Knowledge (variable): A knowledge (section 2.2.1.13) that specifies the current state of the file on the server.");

            // Verify the compound related requirements.
            this.ExpectSingleObject(instance.QueryChangesResponseStart, site);
        }
Esempio n. 52
0
        /// <summary>
        /// Capture requirements related to GetVersions sub response.
        /// </summary>
        /// <param name="getVersionsSubResponse">Containing the getVersionsSubResponse information.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateGetVersionsSubResponse(GetVersionsSubResponseType getVersionsSubResponse, ITestSite site)
        {
            ValidateSubResponseType(getVersionsSubResponse as SubResponseType, site);

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

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2020
            // if can launch this method, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(GetVersionsSubResponseType),
                getVersionsSubResponse.GetType(),
                "MS-FSSHTTP",
                2020,
                @"[In GetVersions Subrequest][The protocol client sends a GetVersions SubRequest message, which is of type GetVersionsSubRequestType] The protocol server responds with a GetVersions SubResponse message, which is of type GetVersionsSubResponseType as specified in section 2.3.1.32.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2026
            // if can launch this method, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2026,
                @"[In GetVersions Subrequest] The Results element, as specified in [MS-VERSS] section 2.2.4.1, is a complex type that specifies information about the file's versions.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2301
            // If isSchemaValid is true, the GetVersionsSubResponseType schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2301,
                @"[In GetVersionsSubResponseType][In Results] The DeleteAllVersions, DeleteVersion, GetVersions, and RestoreVersion methods return the Results complex type.
                     <s:complexType name=""Results"">
                       <s:sequence>
                         <s:element name=""list"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""id"" type=""s:string"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""versioning"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""enabled"" type=""s:unsignedByte"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""settings"" maxOccurs=""1"" minOccurs=""1"">
                           <s:complexType>
                             <s:attribute name=""url"" type=""s:string"" use=""required"" />
                           </s:complexType>
                         </s:element>
                         <s:element name=""result"" maxOccurs=""unbounded"" minOccurs=""1"" type=""tns:VersionData""/>
                       </s:sequence>
                     </s:complexType>");

            if (getVersionsSubResponse.GetVersionsResponse != null)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2303
                // Add the log information.
                site.Log.Add(LogEntryKind.Debug, "For requirement MS-FSSHTTP_R2303, the versioning.enabled MUST be '0' or '1', the versioning.enabled value is : {0}", getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled.ToString());

                // if can launch this method and the versioning.enabled schema matches and value must be 0 or 1.
                bool isVerifyR2303 = getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled == 0 || getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.versioning.enabled == 1;
                site.CaptureRequirementIfIsTrue(
                    isVerifyR2303,
                    "MS-FSSHTTP",
                    2303,
                    @"[In GetVersionsSubResponseType][Results complex type] versioning.enabled: The value of this attribute [versioning.enabled] MUST be ""0"" or ""1"".");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2308
                // if can launch this method, the versioning.enabled schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2308,
                    @"[In GetVersionsSubResponseType][In VersionData] The VersionData complex type specifies the details about a single version of a file.
                     <s:complexType name=""VersionData"">
                       <s:attribute name=""version"" type=""s:string"" use=""required"" />
                       <s:attribute name=""url"" type=""s:string"" use=""required"" />
                       <s:attribute name=""created"" type=""s:string"" use=""required"" />
                       <s:attribute name=""createdRaw"" type=""s:string"" use=""required"" />  
                       <s:attribute name=""createdBy"" type=""s:string"" use=""required"" />
                       <s:attribute name=""createdByName"" type=""s:string"" use=""optional"" />
                       <s:attribute name=""size"" type=""s:unsignedLong"" use=""required"" />
                       <s:attribute name=""comments"" type=""s:string"" use=""required"" />
                     </s:complexType>");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3083
                // if can launch this method, the versioning.enabled schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    3083,
                    @"[In GetVersionsResponse][The schema of GetVersionsResponse element is defined as:] 
                     <s:element name=""GetVersionsResponse"">
                       <s:complexType>
                         <s:sequence>
                           <s:element minOccurs=""1"" maxOccurs=""1"" name=""GetVersionsResult"">
                             <s:complexType>
                               <s:sequence>
                                 <s:element name=""results"" minOccurs=""1"" maxOccurs=""1"" type=""tns:Results"" />
                               </s:sequence>
                             </s:complexType>
                           </s:element>
                         </s:sequence>
                       </s:complexType>
                     </s:element>");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3084
                // if can launch this method, the versioning.enabled schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    3084,
                    @"[In GetVersionsResponse] GetVersionsResult: An XML node that conforms to the structure specified in section 2.2.4.1. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2306
                // if can launch this method, the versioning.enabled schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2306,
                    @"[In GetVersionsSubResponseType][Results complex type] settings.url: Specifies the URL to the webpage of versioning-related settings for the document library in which the file resides. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R60101
                // if can launch this method, the versioning.enabled schema matches.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    60101,
                    @"[In GetVersionsSubResponseType][VersionData] Implementation does contain the version of the file, including the major version and minor version numbers connected by period, for example, ""1.0"". (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 and above follow this behavior.)");
            }
        }
        /// <summary>
        /// This method is used to test Response Error 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 VerifyErrorStringSupplementalInfo(ErrorStringSupplementalInfo instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the ErrorStringSupplementalInfo related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type ErrorStringSupplementalInfo 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_R99063, if the header type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     99063,
                     @"[In Response Error] Error String Supplemental Info Start (4 bytes, optional): Zero or one 32-bit stream object header (section 2.2.1.5.2) that specifies an error string supplemental info start. ");

            // Directly capture requirement MS-FSSHTTPB_R99064, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     99064,
                     @"[In Response Error] Error String Supplemental Info (variable): A string item (section 2.2.1.4) that specifies the supplemental information of the error string for the error string supplemental info start.");

            this.ExpectSingleObject(instance.StreamObjectHeaderStart, 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>
        /// This method is used to test AppliedStorageIndex 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 VerifyPutChangesResponse(PutChangesResponse instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Win32 Error related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type Win32Error is null due to parsing error or type casting error.");
            }

            this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);

            // Capture requirement MS-FSSHTTPB_R99059, if the header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     99059,
                     @"[In Put Changes] Put Changes Response (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a Put Changes response.");

            // Directly capture requirement MS-FSSHTTPB_R99060, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     99060,
                     @"[In Put Changes] Applied Storage Index Id (variable): An extended GUID (section 2.2.1.7) that specifies the applied storage index ID.");

            // Directly capture requirement MS-FSSHTTPB_R99061, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     99061,
                     @"[In Put Changes] Data Elements Added (variable): An extended GUID array (section 2.2.1.8) that specifies the data element identifiers of the added data elements.");
        }
        /// <summary>
        /// Capture requirements related with WhoAmISubResponseDataType
        /// </summary>
        /// <param name="whoamiSubResponseData">The WhoAmISubResponseData information</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateWhoAmISubResponseDataType(WhoAmISubResponseDataType whoamiSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R757
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     757,
                     @"[In WhoAmISubResponseDataType][WhoAmISubResponseDataType schema is:]
                     <xs:complexType name=""WhoAmISubResponseDataType"">
                     <xs:attributeGroup ref=""tns:WhoAmISubResponseDataOptionalAttributes""/>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1396
            // The SubResponseData of WhoamiSubResponse is of type WhoAmISubResponseDataType, so if whoamiSubResponse.SubResponseData is not null, then MS-FSSHTTP_R1396 can be captured.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(WhoAmISubResponseDataType),
                     whoamiSubResponseData.GetType(),
                     "MS-FSSHTTP",
                     1396,
                     @"[In SubResponseDataGenericType][SubResponseDataGenericType MUST take one of the forms described in the following table] WhoAmISubResponseDataType: Type definition for Who Am I subresponse data.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1322
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(WhoAmISubResponseDataType),
                     whoamiSubResponseData.GetType(),
                     "MS-FSSHTTP",
                     1322,
                     @"[In WhoAmI Subrequest] The WhoAmISubResponseDataType defines the type of the SubResponseData element inside the WhoAmI SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1543
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1543,
                     @"[In WhoAmISubResponseDataOptionalAttributes][UserLoginType] The UserLogin attribute MUST be specified in a WhoAmI subresponse that is generated in response to a WhoAmI subrequest.");

            if (whoamiSubResponseData.UserName != null
                || whoamiSubResponseData.UserEmailAddress != null
                || whoamiSubResponseData.UserSIPAddress != null)
            {
                // Verify requirements related with WhoAmISubResponseDataOptionalAttributes
                ValidateWhoAmISubResponseDataOptionalAttributes(whoamiSubResponseData, site);
            }
        }
        /// <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>
        /// 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 BLOCK_RANGE structure releated requirements.
        /// </summary>
        /// <param name="blockRange">BLOCK_RANGE object</param>
        public static void CaptureBlockRangeRequirements(BLOCK_RANGE blockRange)
        {
            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R26");

            // Verify MS-PCCRR requirement: MS-PCCRR_R26
            site.CaptureRequirementIfAreEqual <int>(
                4,
                Marshal.SizeOf(blockRange.Index),
                26,
                @"[In BLOCK_RANGE]Index (4 bytes):  The index of the first block in the range.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R27");

            // Verify MS-PCCRR requirement: MS-PCCRR_R27
            // Eccept the 4 bytes, this sentence is internal behavior, so this requirements can noly be
            // verified a small part.
            site.CaptureRequirementIfAreEqual <int>(
                4,
                Marshal.SizeOf(blockRange.Count),
                27,
                @"[In BLOCK_RANGE]Count (4 bytes):  Count of consecutive adjacent blocks in that range, including
                the block at the Index location.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R28");

            // Verify MS-PCCRR requirement: MS-PCCRR_R28
            bool isVerifyR28 = blockRange.Count > 0;

            site.CaptureRequirementIfIsTrue(
                isVerifyR28,
                28,
                @"[In BLOCK_RANGE][Count (4 bytes)]The value of this field MUST be greater than 0.");

            // If R26 and R27 is verified successfully, means this RS can be verified directly.
            site.CaptureRequirement(
                25,
                @"[In BLOCK_RANGE]A BLOCK_RANGE is an array of two integers that defines 
                a consecutive array of blocks.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R29");

            // Verify MS-PCCRR requirement: MS-PCCRR_R29
            bool isVerifyR29 = blockRange.Index >= 0x00000000 && blockRange.Index <= 0xFFFFFFFF;

            site.CaptureRequirementIfIsTrue(
                isVerifyR29,
                29,
                @"[In BLOCK_RANGE]Index is integer fields in the range of 0x00000000 to 0xFFFFFFFF.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R2900");

            // Verify MS-PCCRR requirement: MS-PCCRR_R2900
            bool isVerifyR2900 = blockRange.Count >= 0x00000000 && blockRange.Count <= 0xFFFFFFFF;

            site.CaptureRequirementIfIsTrue(
                isVerifyR2900,
                2900,
                @"[In BLOCK_RANGE]Count is integer fields in the range of 0x00000000 to 0xFFFFFFFF.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R30");

            // Verify MS-PCCRR requirement: MS-PCCRR_R30
            bool isVerifyR30 = blockRange.Index >= 0 && blockRange.Index <= 511;

            site.CaptureRequirementIfIsTrue(
                isVerifyR30,
                30,
                @"[In BLOCK_RANGE][Index field]contain a value in the range from 0 to 511 (inclusive) for
                the Index field.");

            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R31");

            // Verify MS-PCCRR requirement: MS-PCCRR_R31
            bool isVerifyR31 = blockRange.Count >= 1 && blockRange.Count <= 511;

            site.CaptureRequirementIfIsTrue(
                isVerifyR31,
                31,
                @"[In BLOCK_RANGE][Count field contains a value in the range from]1 to 511–Index (inclusive)
                for the Count field.");
        }
        /// <summary>
        /// Verify ObjectGroupObjectData for the Intermediate node object group related requirements.
        /// </summary>
        /// <param name="objectGroupObjectData">Specify the objectGroupObjectData instance.</param>
        /// <param name="intermediateDeclare">Specify the intermediate declare instance.</param>
        /// <param name="objectGroupList">Specify all the ObjectGroupDataElementData list.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyObjectGroupObjectDataForIntermediateNode(ObjectGroupObjectData objectGroupObjectData, ObjectGroupObjectDeclare intermediateDeclare, List<ObjectGroupDataElementData> objectGroupList, ITestSite site)
        {
            #region Verify the Object Group Object Data

            ExGUIDArray childObjectExGuidArray = objectGroupObjectData.ObjectExGUIDArray;

            if (childObjectExGuidArray != null && childObjectExGuidArray.Count.DecodedValue != 0)
            {
                // If the intermediate node can be build then verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R65
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         65,
                         @"[In Intermediate Node Object References] The Object Extended GUID Array, as specified in [MS-FSSHTTPB] section 2.2.1.12.6.4, of the Intermediate Node Object MUST specify an ordered set of Object Extended GUIDs.");

                // If the intermediate node can be build then verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8007 and MS-FSSHTTPD_R8008
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         8007,
                         @"[In Common Node Object Properties][Intermediate of Object Extended GUID Array field] Specifies an ordered list of the Object Extended GUIDs for each child of this Node.");

                // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8008
                site.CaptureRequirement(
                         "MS-FSSHTTPD",
                         8008,
                         @"[In Common Node Object Properties][Intermediate of Object Extended GUID Array field] Object Extended GUID Array entries MUST be ordered based on the sequential file bytes represented by each Node Object.");
            }

            // Cell ID Array : Specifies an empty list of Cell IDs.
            CellIDArray cellIDArray = objectGroupObjectData.CellIDArray;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Cell ID Array is:{0}", cellIDArray.Count);

            // If the Cell ID Array is an empty list, indicates that the count of the array is 0.
            // So capture these requirements.
            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R5
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     5,
                     @"[In Common Node Object Properties][Intermediate of Cell ID Array field] Specifies an empty list of Cell IDs.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R67
            site.CaptureRequirementIfAreEqual<ulong>(
                     0,
                     cellIDArray.Count,
                     "MS-FSSHTTPD",
                     67,
                     @"[In Intermediate Node Object Cell References] The Cell Reference Array of the Object MUST specify an empty array.");

            #endregion 

            #region Verify the Object Group Object Declaration

            // Object Extended GUID : An extended GUID which specifies an identifier for this object. This GUID MUST be unique within this file.
            ExGuid currentObjectExGuid = intermediateDeclare.ObjectExtendedGUID;

            // Check whether Object Extended GUID is unique.
            bool isVerify8102 = IsGuidUnique(currentObjectExGuid, objectGroupList);

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "Whether the Object Extended GUID is unique:{0}", isVerify8102);

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8102
            site.CaptureRequirementIfIsTrue(
                     isVerify8102,
                     "MS-FSSHTTPD",
                     8102,
                     @"[In Common Node Object Properties][Intermediate of Object Extended GUID Field] This GUID[Object Extended GUID] MUST  be different within this file in once response.");

            // Object Partition ID : A compact unsigned 64-bit integer which MUST be 1.
            Compact64bitInt objectPartitionID = intermediateDeclare.ObjectPartitionID;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Object Partition ID is:{0}", objectPartitionID.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectPartitionID.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(objectPartitionID.DecodedValue == 1, "The actual value of objectPartitionID should be 1.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R18            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     18,
                     @"[In Common Node Object Properties][Intermediate of Object Partition ID field] A compact unsigned 64-bit integer that MUST be ""1"".");

            // Object Data Size :A compact unsigned 64-bit integer which MUST be the size of the Object Data field.
            Compact64bitInt objectDataSize = intermediateDeclare.ObjectDataSize;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Object Data Size is:{0}", objectDataSize.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectDataSize.GetType()), "The type of objectPartitionID should be a compact unsigned 64-bit integer.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R21            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     21,
                     @"[In Common Node Object Properties][Intermediate of Object Data Size field] A compact unsigned 64-bit integer that MUST be the size of the Object Data field.");

            // Object References Count : A compact unsigned 64-bit integer that specifies the number of object references.
            Compact64bitInt objectReferencesCount = intermediateDeclare.ObjectReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The count of Object References is:{0}", objectReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(objectReferencesCount.GetType()), "The type of objectReferencesCount should be a compact unsigned 64-bit integer.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R24            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     24,
                     @"[In Common Node Object Properties][Intermediate of Object References Count field] A compact unsigned 64-bit integer that specifies the number of object references.");

            // Cell References Count : A compact unsigned 64-bit integer which MUST be 0.
            Compact64bitInt cellReferencesCount = intermediateDeclare.CellReferencesCount;

            // Add the log information.
            site.Log.Add(LogEntryKind.Debug, "The value of Cell References is:{0}", cellReferencesCount.DecodedValue);

            site.Assert.IsTrue(typeof(Compact64bitInt).Equals(cellReferencesCount.GetType()), "The type of cellReferencesCount should be a compact unsigned 64-bit integer.");
            site.Assert.IsTrue(cellReferencesCount.DecodedValue == 0, "The value of cellReferencesCount should be 0.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R27            
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     27,
                     @"[In Common Node Object Properties][Intermediate of Cell References Count field] A compact unsigned 64-bit integer that MUST be zero.");

            #endregion 
        }