Microsoft.Protocols.TestSuites.MS_SITESS.S02_ManageSubSite.VerifySoapFaultDetail C# (CSharp) Méthode

VerifySoapFaultDetail() public méthode

Verify SoapFaultDetail message.
public VerifySoapFaultDetail ( System.Web.Services.Protocols.SoapException soapFault ) : void
soapFault System.Web.Services.Protocols.SoapException A SoapException contains Soap fault message.
Résultat void
        public void VerifySoapFaultDetail(SoapException soapFault)
        {
            bool isSchemaRight = false;
            string detailBody = SchemaValidation.GetSoapFaultDetailBody(SchemaValidation.LastRawResponseXml.OuterXml);
            ValidationResult detailResult = SchemaValidation.ValidateXml(this.Site, detailBody);
            isSchemaRight = detailResult.Equals(ValidationResult.Success);

            // If the errorSchema is right, R9 can be captured.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R9");

            // Verify MS-SITESS requirement: MS-SITESS_R9
            Site.CaptureRequirementIfIsTrue(
                isSchemaRight,
                9,
                @"[In SOAPFaultDetails] [The SOAPFaultDetails is defined as:] <s:schema xmlns:s=""http://www.w3.org/2001/XMLSchema"" targetNamespace="" http://schemas.microsoft.com/sharepoint/soap"">
              <s:complexType name=""SOAPFaultDetails"">
              <s:sequence>
              <s:element name=""errorstring"" type=""s:string""/>
              <s:element name=""errorcode"" type=""s:string"" minOccurs=""0""/>
              </s:sequence>
              </s:complexType>
              </s:schema>");

            string errorCode = Common.ExtractErrorCodeFromSoapFault(soapFault);

            // If error code is empty, R422 can be verified.
            if (string.IsNullOrEmpty(errorCode))
            {
                // If the errorSchema is right, R422 can be captured.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R422");

                // Verify MS-SITESS requirement: MS-SITESS_R422
                Site.CaptureRequirementIfIsTrue(
                    isSchemaRight,
                    422,
                    @"[In SOAPFaultDetails] This element [errorcode] is optional.");
            }

            // If error code is not empty, R421 can be verified.
            if (!string.IsNullOrEmpty(errorCode))
            {
                // If the errorSchema is right, R421 can be captured.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R421, the error code is {0}.", errorCode);

                bool isVerify421 = errorCode.Length.Equals(10) && errorCode.StartsWith("0x", StringComparison.CurrentCulture);

                // Verify MS-SITESS requirement: MS-SITESS_R421
                Site.CaptureRequirementIfIsTrue(
                    isVerify421,
                    421,
                    @"[In SOAPFaultDetails] errorcode: The hexadecimal representation of a four-byte result code.");
            }
        }