/// <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. 2
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);
        }
Esempio n. 3
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 CellRequestErrorCodeTypes.
        /// </summary>
        /// <param name="cellRequestErrorCode">A cellRequestErrorCode</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateCellRequestErrorCodeTypes(ErrorCodeType cellRequestErrorCode, ITestSite site)
        {
            if (cellRequestErrorCode == ErrorCodeType.CellRequestFail || cellRequestErrorCode == ErrorCodeType.IRMDocLibarysOnlySupportWebDAV)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R772
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    772,
                    @"[In CellRequestErrorCodeTypes][CellRequestErrorCodeTypes schema is:]
                         <xs:simpleType name=""CellRequestErrorCodeTypes"">
                           <xs:restriction base=""xs:string"">
                             <!--cell request fail-->
                             <xs:enumeration value=""CellRequestFail""/>
                                <!--cell request etag not matching-->
                             <xs:enumeration value=""IRMDocLibarysOnlySupportWebDAV""/>
                           </xs:restriction>
                         </xs:simpleType>");

                // If the validation succeed, then the requirement MS-FSSHTTP_R773 can be captured.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    773,
                    @"[In CellRequestErrorCodeTypes] The value of CellRequestErrorCodeTypes MUST be one of the following:
                         [CellRequestFail, IRMDocLibarysOnlySupportWebDAV]");
            }
        }
        /// <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. ");
        }
        /// <summary>
        /// Capture http releated requirements.
        /// </summary>
        public static void CaptureHttpRequirements()
        {
            //
            // Add the debug information
            //
            site.Log.Add(LogEntryKind.Debug, "Verify MS-PCCRR_R8");

            // Verify MS-PCCRR requirement: MS-PCCRR_R8
            site.CaptureRequirement(
                8,
                @"[In Peer Download Transport]Both the Retrieval Protocol request and response message types are included
                in the body of the HTTP messages.");

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

            // Verify MS-PCCRR requirement: MS-PCCRR_R9001
            site.CaptureRequirement(
                9001,
                @"[In Peer Download Transport]The payload of each such HTTP request consists solely of a single
                Retrieval Protocol message, with the response message prefixed with an additional length field
                (as defined in section 2.2.2) for reassembly purposes.");
        }
Esempio n. 7
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. 9
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.");
        }
        /// <summary>
        /// Capture requirements related with WhoAmISubResponseDataOptionalAttributes.
        /// </summary>
        /// <param name="whoamiSubResponseData">The WhoAmISubResponseData</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateWhoAmISubResponseDataOptionalAttributes(WhoAmISubResponseDataType whoamiSubResponseData, ITestSite site)
        {
            if (whoamiSubResponseData.UserName != null)
            {
                // Verify requirements related with UserNameTypes
                ValidateUserNameTypes(site);

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R794
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    794,
                    @"[In UserNameType] UserNameType is the type definition of the UserName attribute, which is part of the subresponse for a Who Am I subrequest.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2130
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2130,
                    @" [In WhoAmISubResponseDataOptionalAttributes] UserName: [is] A UserNameType [that specifies the user name for the client.]");
            }

            if (!string.IsNullOrEmpty(whoamiSubResponseData.UserEmailAddress))
            {
                ValidateUserEmailAddress(whoamiSubResponseData.UserEmailAddress, site);
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R903
            site.CaptureRequirement(
                "MS-FSSHTTP",
                903,
                @"[In WhoAmISubResponseDataOptionalAttributes] The schema definition of the WhoAmISubResponseDataOptionalAttributes attribute group is as follows:
                     <xs:attributeGroup name=""WhoAmISubResponseDataOptionalAttributes"">
                         < xs:attribute name = ""UserName"" type = ""tns:UserNameType"" use = ""optional"" />
                         < xs:attribute name = ""UserEmailAddress"" type = ""xs:string"" use = ""optional"" />
                         < xs:attribute name = ""UserSIPAddress"" type = ""xs:string"" use = ""optional"" />
                         < xs:attribute name = ""UserIsAnonymous"" type = ""xs:boolean"" use = ""optional"" />
                         < xs:attribute name = ""UserLogin"" type = ""xs:UserLoginType"" use = ""required"" />
                     </ xs:attributeGroup > ");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1466
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1466,
                @"[In WhoAmISubResponseDataOptionalAttributes] The WhoAmISubResponseDataOptionalAttributes attribute group contains attributes that MUST be used in SubResponseData elements associated with a subresponse for a Who Am I subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1477
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1477,
                @"[In SubResponseDataOptionalAttributes] WhoAmISubResponseDataOptionalAttributes: An attribute group that specifies attributes that MUST be used for SubResponseData elements associated with a subresponse for a WhoAmI subrequest.");
        }
        /// <summary>
        /// This method is used to test Transport related adapter requirements.
        /// </summary>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyTransport(ITestSite site)
        {
            // Directly capture requirement MS-FSSHTTPB_R7, if embedded text in the cell sub response in the MS-FSSHTTP can be parsed successfully. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     7,
                     @"[In Transport] This protocol[MS-FSSHTTPB] uses File Synchronization via SOAP over HTTP protocol as specified in [MS-FSSHTTP].");

            // Directly capture requirement MS-FSSHTTPB_R8, if embedded text in the cell sub response in the MS-FSSHTTP can be parsed successfully. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     8,
                     @"[In Common Data Types] Unless noted otherwise, the following statements apply to this specification[MS-FSSHTTPB]:
                     Fields that consist of more than a single byte are specified in little-endian byte order.");
        }
Esempio n. 12
0
        /// <summary>
        /// This method is used to test Transport related adapter requirements.
        /// </summary>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyTransport(ITestSite site)
        {
            // Directly capture requirement MS-FSSHTTPB_R7, if embedded text in the cell sub response in the MS-FSSHTTP can be parsed successfully.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                7,
                @"[In Transport] This protocol[MS-FSSHTTPB] uses File Synchronization via SOAP over HTTP protocol as specified in [MS-FSSHTTP].");

            // Directly capture requirement MS-FSSHTTPB_R8, if embedded text in the cell sub response in the MS-FSSHTTP can be parsed successfully.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                8,
                @"[In Common Data Types] Unless noted otherwise, the following statements apply to this specification[MS-FSSHTTPB]:
                     Fields that consist of more than a single byte are specified in little-endian byte order.");
        }
Esempio n. 13
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);
        }
        /// <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 ExclusiveLockSubResponseDataType.
        /// </summary>
        /// <param name="exclusiveLockSubResponseDataType">The ExclusiveLockSubResponseDataType</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateExclusiveLockSubResponseDataType(ExclusiveLockSubResponseDataType exclusiveLockSubResponseDataType, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R645
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                645,
                @"[In ExclusiveLockSubResponseDataType][ExclusiveLockSubResponseDataType schema is:]
                     <xs:complexType name=""ExclusiveLockSubResponseDataType"">
                         <xs:attribute name=""CoauthStatus"" type=""tns:CoauthStatusType"" use=""optional""/>
                         <xs:attribute name=""TransitionID"" type=""tns:guid"" use=""optional""/>
                     </xs:complexType>");
            if (exclusiveLockSubResponseDataType.CoauthStatusSpecified)
            {
                // Verify the CoauthStatusType schema related requirements.
                ValidateCoauthStatusType(site);
            }

            if (exclusiveLockSubResponseDataType.TransitionID != null)
            {
                // Verify the GUID schema related requirements.
                ValidateGUID(site);
            }

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

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

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1225
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1225,
                @"[In ExclusiveLock Subrequest] The ExclusiveLockSubResponseDataType defines the type of the SubResponseData element inside the exclusive lock SubResponse element.");
        }
        /// <summary>
        /// Capture requirements related with UserNameTypes.
        /// </summary>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateUserNameTypes(ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R793 and MS-FSSHTTP_R1826
            // The UserNameTypes is derived from NCName, so if the NCName type validation passes, then MS-FSSHTTP_R793 and MS-FSSHTTP_R1826 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     793,
                     @"[In UserNameType] The UserNameType simple type specifies a representation of a user name value as specified in [RFC2822].");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1826
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1826,
                     @"[In UserNameType][The schema of UserNameType is] 
                     <xs:simpleType name=""UserNameType"">
                         <xs:restriction base=""xs:string"">
                         </xs:restriction>
                     </xs:simpleType> ");
        }
Esempio n. 17
0
        /// <summary>
        /// Capture requirements related with GetDocMetaInfoSubResponseType.
        /// </summary>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateGetDocMetaInfoSubResponseData(ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1785
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1785,
                @"[In GetDocMetaInfoPropertySetType][The schema of GetDocMetaInfoPropertySetType is] <xs:complexType name=""GetDocMetaInfoPropertySetType"">
                         <xs:sequence minOccurs=""0"" maxOccurs=""unbounded"">
                           <xs:element name=""Property"" type=""tns:GetDocMetaInfoPropertyType""/>
                         </xs:sequence>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1789
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1789,
                @"[In GetDocMetaInfoPropertyType][The schema of GetDocMetaInfoPropertyType is] <xs:complexType name=""GetDocMetaInfoPropertyType"">
                         <xs:attribute name=""Key"" type=""xs:string"" use=""required""/>
                         <xs:attribute name=""Value"" type=""xs:string"" use=""required""/>
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2009
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                2009,
                @"[In GetDocMetaInfo Subrequest] GetDocMetaInfoSubResponseDataType defines the type of the SubResponseData element inside the GetDocMetaInfo SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1782
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1782,
                @"[In GetDocMetaInfoSubResponseDataType][The schema of GetDocMetaInfoSubResponseDataType is] 
                     <xs:complexType name=""GetDocMetaInfoSubResponseDataType"">
                         <xs:sequence>
                           <xs:element name=""DocProps"" type=""tns:GetDocMetaInfoPropertySetType""/>
                           <xs:element name=""FolderProps"" type=""tns:GetDocMetaInfoPropertySetType""/>
                         </xs:sequence>
                     </xs:complexType>");
        }
        /// <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 common requirements shared by both of client role and server role.
        /// </summary>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureCommonRequirements(ITestSite site)
        {
            // Since the message parsed by stack layer properly, capture the requirement directly.
            site.CaptureRequirement(
                1,
                @"[In Transport] The Discovery Protocol uses the Web Services Dynamic Discovery (WS-Discovery)
                protocol[, and the actual transport protocol is abstracted by WSD].");

            // Since the message parsed by stack layer properly, capture the requirement directly.
            site.CaptureRequirement(
                13,
                @"[In Namespaces] The XML namespace URI that MUST be used by the implementation of the Discovery Protocol
                is: http://schemas.microsoft.com/p2p/2007/09/PeerDistributionDiscovery.");

            // Since the test suite use UDP as transport and the message parsed by stack layer properly,
            // capture the requirement directly.
            site.CaptureRequirement(
                176,
                "PCCRD messages sent over UDP MUST be sent using SOAP over UDP [SOAP/UDP].");
        }
        /// <summary>
        /// Capture common requirements shared by both of client role and server role.
        /// </summary>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureCommonRequirements(ITestSite site)
        {
            // Since the message parsed by stack layer properly, capture the requirement directly.
            site.CaptureRequirement(
                1,
                @"[In Transport] The Discovery Protocol uses the Web Services Dynamic Discovery (WS-Discovery)
                protocol[, and the actual transport protocol is abstracted by WSD].");

            // Since the message parsed by stack layer properly, capture the requirement directly.
            site.CaptureRequirement(
                13,
                @"[In Namespaces] The XML namespace URI that MUST be used by the implementation of the Discovery Protocol
                is: http://schemas.microsoft.com/p2p/2007/09/PeerDistributionDiscovery.");

            // Since the test suite use UDP as transport and the message parsed by stack layer properly,
            // capture the requirement directly.
            site.CaptureRequirement(
                176,
                "PCCRD messages sent over UDP MUST be sent using SOAP over UDP [SOAP/UDP].");
        }
Esempio n. 21
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. 22
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. 23
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>
        /// 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 underlying transport protocol related requirements. They can be captured directly when the server returns a SOAP response successfully.
        /// </summary>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateTransport(ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1
            // Since all the messages are transported following Http configured in BasicHttpBinding_ICellStorages, so MS-FSSHTTP_R1 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     1,
                     @"[In Transport] Protocol servers MUST support SOAP over HTTP, as specified in [RFC2616].");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2
            // Since all the messages are SOAP1.1 message configured in BasicHttpBinding_ICellStorages, so MS-FSSHTTP_R2 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     2,
                     @"[In Transport] Protocol messages MUST be formatted as specified in [SOAP1.1] section 4.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3
            // Since all the messages are SOAP1.1 message configured in BasicHttpBinding_ICellStorages, so MS-FSSHTTP_R3 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     3,
                     @"[In Transport] Protocol server MUST use MTOM encoding as specified in [SOAP1.2-MTOM].");
        }
Esempio n. 27
0
        /// <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:extension>
   </xs:complexContent>
 </xs:complexType>");
        }
        private void CheckOperation(IMethodCallMessage mcall)
        {
            Object[] methodAttributes =
                ((MemberInfo)(mcall.MethodBase)).GetCustomAttributes(typeof(RequirementAttribute), true);

            foreach (Object methodAttibute in methodAttributes)
            {
                if (((System.Type)(((Attribute)methodAttibute).TypeId)) == typeof(RequirementAttribute))
                {
                    RequirementAttribute opAttribute = (RequirementAttribute)methodAttibute;
                    site.CaptureRequirement(opAttribute.ProtocolDocName, opAttribute.RequirementID, opAttribute.Description);
                }
            }
        }
Esempio n. 29
0
        /// <summary>
        ///  A method used to process unsupported Product behavior, it perform a directly capture for a requirement which describe an implementation does support  products.
        /// </summary>
        /// <param name="testDocumentShortName">The value of the test document short name.</param>
        /// <param name="requirementId">The value of the test requirement id of which requirement describe an implementation does support  products. </param>
        /// <param name="requirementDescription">The value of the test requirement description.</param>
        /// <param name="currentTestSite">An instance of the TestSite.</param>
        public static void ProcessingUnsupportProducts(string testDocumentShortName, int requirementId, string requirementDescription, ITestSite currentTestSite)
        {
            if (null == currentTestSite)
            {
                throw new ArgumentNullException("currentTestSite");
            }

            if (Common.IsRequirementEnabled(testDocumentShortName, requirementId, currentTestSite))
            {
                string documentShortName = string.Empty;

                // If the testDocumentShortName parameter do not have value, try to get from the DefaultProtocolDocShortName property of ITestSite instance.
                if (string.IsNullOrEmpty(testDocumentShortName))
                {
                    documentShortName = currentTestSite.DefaultProtocolDocShortName;
                }
                else
                {
                    documentShortName = testDocumentShortName;
                }

                if (string.IsNullOrEmpty(documentShortName))
                {
                    currentTestSite.CaptureRequirement(requirementId, requirementDescription);
                }
                else
                {
                    currentTestSite.CaptureRequirement(documentShortName, requirementId, requirementDescription);
                }
            }
            else
            {
                SutVersion currentSutVersion = Common.GetConfigurationPropertyValue <SutVersion>("SutVersion", currentTestSite);
                currentTestSite.Assert.Inconclusive("This test suite does not support current SUT version[{0}].", currentSutVersion);
            }
        }
        /// <summary>
        /// Capture requirements related with CellSubResponseDataOptionalAttributes.
        /// </summary>
        /// <param name="cellSubResponseData">The cellSubResponseData</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateCellSubResponseDataOptionalAttributes(CellSubResponseDataType cellSubResponseData, ITestSite site)
        {
            if (cellSubResponseData.ModifiedBy != null)
            {
                // Verify requirements related with UserNameTypes
                ValidateUserNameTypes(site);
            }

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1465
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1465,
                @"[In CellSubResponseDataOptionalAttributes] The CellSubResponseDataOptionalAttributes attribute group contains attributes that is used in SubResponseData elements associated with a SubResponse for a cell subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1497
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1497,
                @"[In SubResponseDataOptionalAttributes] CellSubResponseDataOptionalAttributes: An attribute group that specifies attributes that MUST be used for SubResponseData elements associated with a subresponse for a cell subrequest.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R839
            site.CaptureRequirement(
                "MS-FSSHTTP",
                839,
                @"[In CellSubResponseDataOptionalAttributes] The definition of the CellSubResponseDataOptionalAttributes attribute group is as follows:
                     <xs:attributeGroup name=""CellSubResponseDataOptionalAttributes"">
                         <xs:attribute name=""Etag"" type=""xs:string"" use=""optional"" />
                         <xs:attribute name=""CreateTime"" type=""xs:integer"" use=""optional""/>
                         <xs:attribute name=""LastModifiedTime"" type=""xs:integer"" use=""optional""/>
                         <xs:attribute name=""ModifiedBy"" type=""tns:UserNameType"" use=""optional"" />
                         <xs:attribute name=""CoalesceErrorMessage"" type=""xs:string"" use=""optional""/>
                         <xs:attribute name=""CoalesceHResult"" type=""xs:integer"" use=""optional""/>
                         <xs:attribute name=""ContainsHotboxData"" type=""tns:TRUEFALSE"" use=""optional""/>
                         <xs:attribute name=""HaveOnlyDemotionChanges"" type=""tns:TRUEFALSE"" use=""optional""/>
                     </xs:attributeGroup>");
        }
Esempio n. 31
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.");
        }
Esempio n. 32
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);
        }
        /// <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. 34
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 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);
        }
        /// <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 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>
        /// 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 verify the requirements for the pre-defined GUID values.
        /// </summary>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyDefinedGUID(ITestSite site)
        {
            // If runs here successfully, then indicating all the following requirements can be directly captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     140,
                     @"[In Cell Properties] The storage manifest data element, as specified in [MS-FSSHTTPB] section 2.2.1.12.3, MUST have the Storage Manifest Schema GUID field set to 0EB93394-571D-41E9-AAD3-880D92D31955.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R141 and MS-FSSHTTPD_R8067
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8067,
                     @"[In Cell Properties] The storage manifest data element MUST have the Cell ID field set to[GUIDs] as listed in the following table: 84DEFAB9-AAA3-4A0D-A3A8-520C77AC7073 and 6F2A4665-42C8-46C7-BAB4-E28FDCE1E32B of Type 4 and Value 1.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R141
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     141,
                     @"[In Cell Properties] The storage manifest data element, as specified in [MS-FSSHTTPB] section 2.2.1.12.3, MUST have the Cell ID field set to extended GUID 5-bit Uint values, as specified in [MS-FSSHTTPB] section 2.2.1.7.2.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R142 and MS-FSSHTTPD_R8068
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     142,
                     @"[In Cell Properties] The storage manifest data element, as specified in [MS-FSSHTTPB] section 2.2.1.12.3, MUST have the Root Extended GUID field set to an extended GUID 5-bit Uint value, as specified in [MS-FSSHTTPB] section 2.2.1.7.2.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8068
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8068,
                     @"[In Cell Properties] The storage manifest data element MUST have the Root Extended GUID field set to[GUIDs] as shown in the following table: 84DEFAB9-AAA3-4A0D-A3A8-520C77AC7073 of Type 4 and Value 2.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R73 and  MS-FSSHTTPD_R8089
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     73,
                     @"[In Cell Properties] The revision manifest data element, as specified in [MS-FSSHTTPB] section 2.2.1.12.5, MUST have a Root Extended GUID field set to an extended GUID 5-bit Uint value that represents the primary content stream, as shown in the following table: 84DEFAB9-AAA3-4A0D-A3A8-520C77AC7073 of Type 4 and Value 2.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8069
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8069,
                     @"[In Cell Properties] The revision manifest data element MUST have a Root Extended GUID field set to[GUIDs] as shown in the following table: 84DEFAB9-AAA3-4A0D-A3A8-520C77AC7073 of Type 4 and Value 2.");
        }
        /// <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 verify the requirements for intermediate node object when the chunk method is zip chunk.
        /// </summary>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifyIntermediateNodeForZipFileChunk(ITestSite site)
        {
            // If runs here successfully, then indicating all the following requirements can be directly captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8045,
                     @"[In Zip Files] Large Final Chunk Signature: The Data Size of the Intermediate Node Object MUST be the total number of bytes represented by the chunk.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8047
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8047,
                     @"[In Zip Files] Large Final Chunk Signature: The Intermediate Node is referenced by its parent node.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8058
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8058,
                     @"[In Zip Files] Sub Chunk Signature: The Object Data of the Data Node Object MUST be the byte sequence from the .ZIP file tracked by the chunk. ");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8059
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8059,
                     @"[In Zip Files] Sub Chunk Signature: The Object Reference Array and the Cell Reference Array of the Data Node Object MUST be empty. ");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8060
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8060,
                     @"[In Zip Files] Sub Chunk Signature: The Object References Array of the Intermediate Node Object associated with this Data Node Object MUST have a single entry, which MUST be the Object ID of the Data Node Object.");
        }
        /// <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 Put 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 VerifyPutChangesSubResponseData(PutChangesSubResponseData instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Put Changes related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type PutChangesSubResponseData is null due to parsing error or type casting error.");
            }

            // Directly capture requirement MS-FSSHTTPB_R610, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     610,
                     @"[In Put Changes] Resultant Knowledge (variable): A knowledge (section 2.2.1.13) that specifies the current state of the file on the server after the changes is merged.");
        }
        /// <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>
        /// 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 
        }
        /// <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>
 /// This method is used to verify the requirements related with the RDC analysis chunk method.
 /// </summary>
 /// <param name="site">Specify the ITestSite instance.</param>
 public static void VerifyRdcAnalysisChunk(ITestSite site)
 {
     // If runs here successfully, then indicating all the following requirements can be directly captured.
     site.CaptureRequirement(
              "MS-FSSHTTPD",
              8063,
              @"[In Generating Chunks] Files are split into chunks by using the RDC FilterMax algorithm, as specified in [MS-RDC] section 3.1.5.1, using a hash window of 48 and a horizon of 16,384.");
 }
        /// <summary>
        /// This method is used to test Allocate ExtendedGuid 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 VerifyAllocateExtendedGuidRangeSubResponseData(AllocateExtendedGuidRangeSubResponseData instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Allocate ExtendedGuid Range related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type AllocateExtendedGuidRangeSubResponseData is null due to parsing error or type casting error.");
            }

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

            // Directly capture requirement MS-FSSHTTPB_R2203, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     2203,
                     @"[In Allocate ExtendedGuid Range] Allocate ExtendedGuid Range Response (4 bytes): A stream object header (section 2.2.1.5) that specifies an allocate extendedGUID range response.");

            // Directly capture requirement MS-FSSHTTPB_R2204, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     2204,
                     @"[In Allocate ExtendedGuid Range] GUID Component (16 bytes): A GUID that specifies the GUID portion of the reserved extended GUIDs (section 2.2.1.7).");

            // Directly capture requirement MS-FSSHTTPB_R2205, if there are no parsing errors. 
            // This requirement is partially captured, only the type "A compact unsigned 64-bit integer" can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     2205,
                     @"[In Allocate ExtendedGuid Range] Integer Range Min (variable): A compact unsigned 64-bit integer (section 2.2.1.1) that specifies the first integer element in the range of extended GUIDs.");

            // Directly capture requirement MS-FSSHTTPB_R2206, if there are no parsing errors. 
            // This requirement is partially captured, only the type "A compact unsigned 64-bit integer" can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     2206,
                     @"[In Allocate ExtendedGuid Range] [Integer Range Max (variable)] specifies the last + 1 integer element in the range of extended GUIDs.");

            bool isVerifiedR99062 = instance.IntegerRangeMax.DecodedValue >= 1000 && instance.IntegerRangeMax.DecodedValue <= 100000;
            site.Log.Add(
                LogEntryKind.Debug,
                "The Integer Range Max should be in the range 1000 and 100000, its actual value is {0}",
                instance.IntegerRangeMax.DecodedValue);

            site.CaptureRequirementIfIsTrue(
                     isVerifiedR99062,
                     "MS-FSSHTTPB",
                     99062,
                     @"[In Allocate ExtendedGuid Range] Integer Range Max (variable): A compact unsigned 64-bit integer with a minimum allowed value of 1000 and maximum allowed value of 100000.");

            // Verify the compound related requirements.
            this.ExpectSingleObject(instance.AllocateExtendedGUIDRangeResponse, site);
        }
        /// <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>
        /// 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 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>
        /// 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>
        /// 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>
        /// This method is used to test Request Type Enumeration related adapter requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        private void VerifyRequestTypes(RequestTypes instance, ITestSite site)
        {
            // Directly capture requirement MS-FSSHTTPB_R176, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     176,
                     @"[In Request Type Enumeration][Request Type Enumeration] Specifies the sub-request type (section 2.2.2.1) to indicate the operation being requested, or the sub-response type (section 2.2.3.1) to indicate the response per the request.");

            // Directly capture requirement MS-FSSHTTPB_R177, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     177,
                     @"[In Request Type Enumeration] The following table enumerates the values for each operation:[Its value must be one of 1,2,5,11].");

            switch ((int)instance)
            {
                case 1:

                    // Directly capture requirement MS-FSSHTTPB_R178, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             178,
                             @"[In Request Type Enumeration][Request Type Enumeration is set to ]1 [specifies a request or response for the ]Query access[operation].");

                    // Directly capture requirement MS-FSSHTTPB_R863, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             863,
                             @"[In Query Access Sub-Request Processing] The server MUST reply back to the client with a Query Access sub-response, as specified in section 2.2.3.1.1.");

                    break;

                case 2:

                    // Directly capture requirement MS-FSSHTTPB_R179, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             179,
                             @"[In Request Type Enumeration][Request Type Enumeration is set to ]2 [specifies a request or response for the ]Query changes[operation].");

                    // Directly capture requirement MS-FSSHTTPB_R865, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             865,
                             @"[In Query Changes Sub-Request Processing] The server MUST reply back to the client with a Query Changes sub-response, as specified in section 2.2.3.1.2. [<5>]");

                    break;

                case 5:

                    // Directly capture requirement MS-FSSHTTPB_R182, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             182,
                             @"[In Request Type Enumeration][Request Type Enumeration is set to ]5 [specifies a request or response for the]Put changes[operation].");

                    // Directly capture requirement MS-FSSHTTPB_R872, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             872,
                             @"[In Put Changes Sub-Request Processing] The server MUST reply back to the client with a Put Changes sub-response, as specified in section 2.2.3.1.3.");

                    break;

                case 11:

                    // Directly capture requirement MS-FSSHTTPB_R2097, if there are no parsing errors. 
                    site.CaptureRequirement(
                             "MS-FSSHTTPB",
                             2097,
                             @"[In Request Type Enumeration][Request Type Enumeration is set to ]11 [specifies a request or response for the] Allocate ExtendedGuid range[operation].");

                    break;

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

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

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

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

            ErrorCodeType errorCode;

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

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

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

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

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

            // Verify requirements related with CellSubResponseDataType
            if (cellSubResponse.SubResponseData != null)
            {
                ValidateCellSubResponseDataType(cellSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// Capture requirements related with AmIAlone Sub-request.
        /// </summary>
        /// <param name="amIAloneSubResponse">Containing the AmIAloneSubResponse information</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateAmIAloneSubResponse(AmIAloneSubResponseType amIAloneSubResponse, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R22555
            site.CaptureRequirement(
                "MS-FSSHTTP",
                22555,
                @"[In AmIAloneSubResponseType]	
  <xs:complexType name=""AmIAloneSubResponseType"" >
   < xs:complexContent >
    < xs:extension base = ""tns:SubResponseType"" >
      < xs:sequence minOccurs = ""0"" maxOccurs = ""1"" >
         < xs:element name = ""SubResponseData"" type = ""tns:AmIAloneSubResponseDataType"" />
      </ xs:sequence >
    </ xs:extension >
  </ xs:complexContent >
</ xs:complexType > ");

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

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

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

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

            ErrorCodeType errorCode;

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

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

            // Verify requirements related with SubResponseDataType
            if (amIAloneSubResponse.SubResponseData != null)
            {
                ValidateAmIAloneSubResponseDataType(amIAloneSubResponse.SubResponseData, site);
            }
        }
        /// <summary>
        /// This method is used to verify the requirements related with the simple chunk method.
        /// </summary>
        /// <param name="site">Specify the ITestSite instance.</param>
        public static void VerifySimpleChunk(ITestSite site)
        {
            // If run here, all the requirements related to simple chunk are carefully examined, so all the requirements can be directly captured.
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     129,
                     @"[In Simple Chunking Method] Simple Small File Hash: A 20-byte sequence that specifies the SHA-1 hash code of the file bytes represented by the chunk.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R134
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     134,
                     @"[In Simple Chunking Method] The Signature Data of the Intermediate Node Object MUST be the chunk’s signature.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R133
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     133,
                     @"[In Simple Chunking Method] The Data Size of the Intermediate Node Object MUST be the total number of bytes represented by the chunk.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R128
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     128,
                     @"[In Simple Chunking Method] Files are split into chunks that are each 1 megabyte in size.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R138
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     138,
                     @"[In Simple Chunking Method] The Object Reference Array and the Cell Reference Array of the Data Node Object MUST be empty.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R136
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     136,
                     @"[In Simple Chunking Method] For all Intermediate Node Objects, a Data Node Object MUST be created.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R139
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     139,
                     @"[In Simple Chunking Method] The Object References Array of the Intermediate Node Object associated with this Data Node Object MUST have a single entry, which MUST be the Object ID of the Data Node Object.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R132
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     132,
                     @"[In Simple Chunking Method] For each chunk in the chunk list, an Intermediate Node Object, as specified in section 2.2.3, is created.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R135
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     135,
                     @"[In Simple Chunking Method] The Intermediate Node is referenced by its parent node.");

            // Verify MS-FSSHTTPD requirement: MS-FSSHTTPD_R8201
            site.CaptureRequirement(
                     "MS-FSSHTTPD",
                     8201,
                     @"[In Simple Chunking Method] The Object Data of the Data Node Object MUST be the byte sequence from the file tracked by the chunk.");
        }
        /// <summary>
        /// Capture requirements related with CoauthSubResponseDataType.
        /// </summary>
        /// <param name="coauthSubResponseData">The CoauthSubResponseDataType</param>
        /// <param name="site">Instance of ITestSite</param>
        public static void ValidateCoauthSubResponseDataType(CoauthSubResponseDataType coauthSubResponseData, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R994
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     994,
                     @"[In Coauth Subrequest] CoauthSubResponseDataType defines the type of the SubResponseData element inside the coauthoring SubResponse element.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R602
            // If SubResponseData exists,its schema will have been validated before invoking the method CaptureJoinCoauthoringSessionRelatedRequirements.
            // So MS-FSSHTTP_R602 can be captured.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     602,
                     @"[In CoauthSubResponseDataType][CoauthSubResponseDataType schema is:]
                     <xs:complexType name=""CoauthSubResponseDataType"">
                         <xs:attribute name=""LockType"" type=""tns:LockTypes"" use=""optional"" />
                         <xs:attribute name=""CoauthStatus"" type=""tns:CoauthStatusType"" use=""optional""/>
                         <xs:attribute name=""TransitionID"" type=""tns:guid"" use=""optional""/>
                         <xs:attribute name=""ExclusiveLockReturnReason"" type=""tns:ExclusiveLockReturnReasonTypes"" use=""optional"" />
                     </xs:complexType>");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R999
            // if can launch this method, the schema matches.
            site.CaptureRequirement(
                     "MS-FSSHTTP",
                     999,
                     @"[In Coauth Subrequest] The SubResponseData element returned for a coauthoring subrequest is of type CoauthSubResponseDataType.");

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

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

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R998
                // if can launch this method, the schema matches.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         998,
                         @"[In Coauth Subrequest] The lock type is specified in the LockType attribute in the coauthoring SubResponseData element.");
            }

            if (coauthSubResponseData.CoauthStatusSpecified)
            {
                // Verify the CoauthStatusType schema related requirements. 
                ValidateCoauthStatusType(site);
            }

            if (coauthSubResponseData.TransitionID != null)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2075, since TransitionID is marked as "tns:guid" type, the following 
                // 2 requirements can be capture if the schema is valid.
                site.CaptureRequirement(
                         "MS-FSSHTTP",
                         2075,
                         @"[In SubResponseDataOptionalAttributes] TransitionID: A guid that specifies the file identifier stored for that file on the protocol server.");

                // Verify the GUID schema related requirements. 
                ValidateGUID(site);
            }

            if (coauthSubResponseData.ExclusiveLockReturnReasonSpecified)
            {
                // Verify the ExclusiveLockReturnReasonTypes schema related requirements.
                ValidateExclusiveLockReturnReasonTypes(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. ");
        }