/// <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> /// 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); } }