Beispiel #1
0
        /// <summary>
        /// This operation is used to remove a given content type from the site.
        /// </summary>
        /// <param name="contentTypeId">contentTypeId is the content type ID of the content type that is to be removed from the site.</param>
        /// <returns>The result of DeleteContentType.</returns>
        public DeleteContentTypeResponseDeleteContentTypeResult DeleteContentType(string contentTypeId)
        {
            DeleteContentTypeResponseDeleteContentTypeResult result = new DeleteContentTypeResponseDeleteContentTypeResult();

            result = this.service.DeleteContentType(contentTypeId);

            this.ValidateDeleteContentType();
            this.CaptureTransportRelatedRequirements();

            return(result);
        }
        /// <summary>
        /// This operation is used to remove a given content type from the site.
        /// </summary>
        /// <param name="contentTypeId">contentTypeId is the content type ID of the content type that is to be removed from the site.</param>
        /// <returns>The result of DeleteContentType.</returns>
        public DeleteContentTypeResponseDeleteContentTypeResult DeleteContentType(string contentTypeId)
        {
            DeleteContentTypeResponseDeleteContentTypeResult result = new DeleteContentTypeResponseDeleteContentTypeResult();

            result = this.service.DeleteContentType(contentTypeId);

            this.ValidateDeleteContentType();
            this.CaptureTransportRelatedRequirements();

            return result;
        }
        /// <summary>
        /// Verify the message syntax of DeleteContentType operation when the response is received 
        /// successfully.
        /// </summary>
        /// <param name="deleteContentTypeResult">The result of the operation.</param>
        private void VerifyDeleteContentTypeOperation(DeleteContentTypeResponseDeleteContentTypeResult deleteContentTypeResult)
        {
            // Verify R1712
            // The response have been received successfully, then the following requirement can be captured.
            // If the response is not received and parsed successfully, the test case will fail before this requirement is captured 
            Site.CaptureRequirement(
                1712,
                @"[The schema of DeleteContentType is defined as:]"
                + @"<wsdl:operation name=""DeleteContentType"">"
                + @"    <wsdl:input message=""DeleteContentTypeSoapIn"" />"
                + @"    <wsdl:output message=""DeleteContentTypeSoapOut"" />"
                + @"</wsdl:operation>");

            // Verify R484
            // The response have been received successfully, then the following requirement can be captured.
            // If the response is not received and parsed successfully, the test case will fail before this requirement is captured 
            Site.CaptureRequirement(
                484,
                @"[In DeleteContentType operation] [If the protocol client sends a "
                + "DeleteContentTypeSoapIn request message] the protocol server responds "
                + "with a DeleteContentTypeSoapOut response message.");

            // Verify R1718
            // The response have been received successfully, then the following requirement can be captured.
            // If the response is not received and parsed successfully, the test case will fail before this requirement is captured 
            Site.CaptureRequirement(
                1718,
                @"[DeleteContentTypeSoapOut]The SOAP Body contains a "
                + "DeleteContentTypeResponse element.");

            // Verify R1722
            // The response have been received successfully, then the following requirement can be captured.
            // If the response is not received and parsed successfully, the test case will fail before this requirement is captured 
            Site.CaptureRequirement(
                1722,
                @"[The schema of DeleteContentTypeResponse is defined as:]"
                + @"<s:element name=""DeleteContentTypeResponse"">"
                + @"  <s:complexType>"
                + @"    <s:sequence>"
                + @"      <s:element name=""DeleteContentTypeResult"" minOccurs=""0"">"
                + @"        <s:complexType mixed=""true"">"
                + @"          <s:sequence>"
                + @"            <s:element name=""Success"">"
                + @"              <s:complexType />"
                + @"            </s:element>"
                + @"          </s:sequence>"
                + @"        </s:complexType>"
                + @"      </s:element>"
                + @"    </s:sequence>"
                + @"  </s:complexType>"
                + @"</s:element>");

            // Verify R495
            // Ensure the SOAP result is de-serialized successfully.
            Site.Assume.IsNotNull(
                deleteContentTypeResult,
                "The result of DeleteContentType operation must not be null.");

            // If no exception thrown and the result is not null, then the following 
            // requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                deleteContentTypeResult,
                495,
                @"[In DeleteContentType operation] If the operation [DeleteContentType] "
                + "succeeds, a DeleteContentTypeResult MUST be returned.");
        }