/// <summary> /// Capture requirements related to exclusive lock sub request of type, "Convert to schema lock with co-authoring transition tracked". /// </summary> /// <param name="exclusiveLockSubResponse">Containing the subResponse information.</param> /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param> public static void ValidateExclusiveLockSubResponse(ExclusiveLockSubResponseType exclusiveLockSubResponse, ITestSite site) { ValidateSubResponseType(exclusiveLockSubResponse as SubResponseType, site); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R659 // if can launch this method, the schema matches. site.CaptureRequirement( "MS-FSSHTTP", 659, @"[In ExclusiveLockSubResponseType][ExclusiveLockSubResponseType schema is:] <xs:complexType name=""ExclusiveLockSubResponseType""> <xs:complexContent> <xs:extension base=""tns:SubResponseType""> <xs:sequence minOccurs=""1"" maxOccurs=""1""> <xs:element name=""SubResponseData"" type=""tns:ExclusiveLockSubResponseDataType"" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>"); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1216 // if can launch this method, the schema matches. site.CaptureRequirement( "MS-FSSHTTP", 1216, @"[In ExclusiveLock Subrequest][The protocol client sends an exclusive lock SubRequest message] The protocol server responds with an exclusive lock SubResponse message, which is of type ExclusiveLockSubResponseType as specified in section 2.3.1.12."); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4689 // if can launch this method, the schema matches. site.CaptureRequirementIfAreEqual<Type>( typeof(ExclusiveLockSubResponseType), exclusiveLockSubResponse.GetType(), "MS-FSSHTTP", 4689, @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms: ExclusiveLockSubResponseType."); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5744 // if can launch this method, the schema matches. site.CaptureRequirementIfAreEqual<Type>( typeof(ExclusiveLockSubResponseType), exclusiveLockSubResponse.GetType(), "MS-FSSHTTP", 5744, @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: ExclusiveLockSubResponseType."); if (string.Compare("Success", exclusiveLockSubResponse.ErrorCode, StringComparison.OrdinalIgnoreCase) == 0) { // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R264 // if can launch this method, the schema matches bool isVerifyR264 = exclusiveLockSubResponse.SubResponseData != null; // If popup the assert, the case run fail. site.Assert.IsTrue( isVerifyR264, "For requirement MS-FSSHTTPB_R264, the SubResponseData should not be NULL."); // If the above logic is right, MS-FSSHTTP_R264 can be captured. site.CaptureRequirement( "MS-FSSHTTP", 264, @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""ExclusiveLock""."); } if (exclusiveLockSubResponse.SubResponseData != null) { ValidateExclusiveLockSubResponseDataType(exclusiveLockSubResponse.SubResponseData, site); } }
/// <summary> /// A method used to verify the invalid argument related requirements. /// </summary> /// <param name="response">The ExclusiveLockSubResponseType instance returns from the server.</param> private void CheckInvalidArgumentRelatedRequirements(ExclusiveLockSubResponseType response) { if (SharedContext.Current.IsMsFsshttpRequirementsCaptured) { // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R6341 Site.CaptureRequirementIfAreEqual<ErrorCodeType>( ErrorCodeType.InvalidArgument, SharedTestSuiteHelper.ConvertToErrorCodeType(response.ErrorCode, this.Site), "MS-FSSHTTP", 6341, @"[In ExclusiveLockSubRequestDataType] If the specified attributes[ExclusiveLockID attribute] are not provided, an ""InvalidArgument"" error code MUST be returned as part of the SubResponseData element associated with the exclusive lock subresponse.<15>"); } else { Site.Assert.AreEqual<ErrorCodeType>( ErrorCodeType.InvalidArgument, SharedTestSuiteHelper.ConvertToErrorCodeType(response.ErrorCode, this.Site), @"[In ExclusiveLockSubRequestDataType] If the specified attributes[ExclusiveLockID attribute] are not provided, an ""InvalidArgument"" error code MUST be returned as part of the SubResponseData element associated with the exclusive lock subresponse.<15>"); } }