Microsoft.Protocols.TestSuites.MS_SITESS.MS_SITESSAdapter.VerifyCreateWeb C# (CSharp) Méthode

VerifyCreateWeb() private méthode

Verify CreateWeb related requirements.
private VerifyCreateWeb ( CreateWebResponseCreateWebResult createWebResult ) : void
createWebResult CreateWebResponseCreateWebResult The result of CreateWeb.
Résultat void
        private void VerifyCreateWeb(CreateWebResponseCreateWebResult createWebResult)
        {
            Site.Log.Add(LogEntryKind.Comment, "Verify common requirements in CreateWeb operation.");
            this.VerifyCommonReqs();

            // When code can run to this line, it indicates the soap out message for this operation is received, else the operation will throw exception above.
            // So this operation's description is consistent with server.
            Site.CaptureRequirement(
                278,
                @"[In CreateWeb] [The CreateWeb operation is defined as:] <wsdl:operation name=""CreateWeb"">
              <wsdl:input message=""tns:CreateWebSoapIn"" />
              <wsdl:output message=""tns:CreateWebSoapOut"" />
              </wsdl:operation>");

            bool isSchemaRight = SchemaValidation.XmlValidationErrors.Count == 0 && SchemaValidation.XmlValidationWarnings.Count == 0;

            // When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R280.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R280");

            // Verify MS-SITESS requirement: MS-SITESS_R280
            Site.CaptureRequirementIfIsTrue(
                isSchemaRight,
                280,
                @"[In CreateWeb] [The client sends a CreateWebSoapIn request message and] the server responds with a CreateWebSoapOut response message upon successful completion of creating the subsite.");

            // When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R289.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R289");

            // Verify MS-SITESS requirement: MS-SITESS_R289
            Site.CaptureRequirementIfIsTrue(
                isSchemaRight,
                289,
                @"[In CreateWebSoapOut] The SOAP body contains a CreateWebResponse element.");

            // When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R310.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R310");

            // Verify MS-SITESS requirement: MS-SITESS_R310
            Site.CaptureRequirementIfIsTrue(
                isSchemaRight,
                310,
                @"[In CreateWebResponse] [The CreateWebResponse element is defined as:] <s:element name=""CreateWebResponse"">
              <s:complexType>
              <s:sequence>
              <s:element minOccurs=""1"" maxOccurs=""1"" name=""CreateWebResult"">
              <s:complexType>
              <s:sequence>
              <s:element minOccurs=""1"" maxOccurs=""1"" name=""CreateWeb"">
              <s:complexType>
              <s:attribute name=""Url"" type=""s:string""/>
              </s:complexType>
              </s:element>
              </s:sequence>
              </s:complexType>
              </s:element>
              </s:sequence>
              </s:complexType>
              </s:element>");

            // Specifies whether the format of the Url is a fully qualified URL.
            bool isURI = false;
            isURI = Uri.IsWellFormedUriString(createWebResult.CreateWeb.Url, UriKind.RelativeOrAbsolute);
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R377, the value of isURI is {0}, the Url is {1}.", isURI, createWebResult.CreateWeb.Url);

            // Verify MS-SITESS requirement: MS-SITESS_R377
            Site.CaptureRequirementIfIsTrue(
                isURI,
                377,
                @"[In CreateWebResponse] Url: The fully qualified URL to the subsite which was successfully created.");
        }