当前位置: 首页>>代码示例>>C#>>正文


C# ITestSite.CaptureRequirement方法代码示例

本文整理汇总了C#中ITestSite.CaptureRequirement方法的典型用法代码示例。如果您正苦于以下问题:C# ITestSite.CaptureRequirement方法的具体用法?C# ITestSite.CaptureRequirement怎么用?C# ITestSite.CaptureRequirement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITestSite的用法示例。


在下文中一共展示了ITestSite.CaptureRequirement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidateEditorsTableSubResponse

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:55,代码来源:MsfsshttpEditorsTableCapture.cs

示例2: VerifyTransport

        /// <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.");
        }
开发者ID:OfficeDev,项目名称:Interop-TestSuites,代码行数:19,代码来源:MsfsshttpbTransportCapture.cs

示例3: ValidateUserNameTypes

        /// <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> ");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:23,代码来源:MsfsshttpCommonCapture.cs

示例4: CaptureCommonRequirements

        /// <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].");
        }
开发者ID:Microsoft,项目名称:WindowsProtocolTestSuites,代码行数:24,代码来源:PccrdBothRoleCaptureCode.cs

示例5: ValidateTransport

        /// <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].");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:27,代码来源:MsfsshttpCommonCapture.cs

示例6: VerifyKnowledge

        /// <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.");
        }
开发者ID:OfficeDev,项目名称:Interop-TestSuites,代码行数:42,代码来源:MsfsshttpbKnowledgeCapture.cs

示例7: VerifyHRESULTError

        /// <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);
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:33,代码来源:MsfsshttpbResponseCapture.cs

示例8: VerifyCellError

        /// <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);
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:95,代码来源:MsfsshttpbResponseCapture.cs

示例9: VerifyResponseError

        /// <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,
//.........这里部分代码省略.........
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:101,代码来源:MsfsshttpbResponseCapture.cs

示例10: VerifyPutChangesSubResponseData

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:19,代码来源:MsfsshttpbResponseCapture.cs

示例11: VerifyWriteAccessResponse

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:48,代码来源:MsfsshttpbResponseCapture.cs

示例12: VerifyFsshttpbSubResponse

        /// <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(
//.........这里部分代码省略.........
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:101,代码来源:MsfsshttpbResponseCapture.cs

示例13: VerifyDefinedGUID

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:48,代码来源:MsfsshttpdCapture.cs

示例14: VerifySimpleChunk

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:66,代码来源:MsfsshttpdCapture.cs

示例15: VerifyIntermediateNodeForZipFileChunk

        /// <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.");
        }
开发者ID:ClareMSYanGit,项目名称:Interop-TestSuites,代码行数:36,代码来源:MsfsshttpdCapture.cs


注:本文中的ITestSite.CaptureRequirement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。