/// <summary> /// AddDiscussionBoardItem operation is used to add new discussion items to a specified discussion board. /// </summary> /// <param name="listName">The name of the discussion board in which the new item will be added</param> /// <param name="message">The message to be added to the discussion board. The message MUST be in MIME format and then Base64 encoded</param> /// <returns>AddDiscussionBoardItem Result</returns> public AddDiscussionBoardItemResponseAddDiscussionBoardItemResult AddDiscussionBoardItem(string listName, byte[] message) { if (null == this.listsProxy) { throw new InvalidOperationException("The Proxy instance is NULL, need to initialize the adapter"); } AddDiscussionBoardItemResponseAddDiscussionBoardItemResult result = null; result = this.listsProxy.AddDiscussionBoardItem(listName, message); this.VerifyTransportRequirement(); return(result); }
/// <summary> /// Verify the message syntax of AddDiscussionBoardItem operation when the response is /// received successfully. /// </summary> /// <param name="addDiscussionBoardItemResult">The returned SOAP result.</param> private void VerifyAddDiscussionBoardItemOperation(AddDiscussionBoardItemResponseAddDiscussionBoardItemResult addDiscussionBoardItemResult) { // Ensure the SOAP result is de-serialized successfully. Site.Assume.IsNotNull( addDiscussionBoardItemResult, "The result of AddAttachment operation must not be null."); // Verify R1571 // 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( 1571, @"[The schema of AddDiscussionBoardItem is defined as:]" + @"<wsdl:operation name=""AddDiscussionBoardItem"">" + @" <wsdl:input message=""AddDiscussionBoardItemSoapIn"" />" + @" <wsdl:output message=""AddDiscussionBoardItemSoapOut"" />" + @"</wsdl:operation>"); // Verify R311 // 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( 311, @"[In AddDiscussionBoardItem operation] [If the protocol client sends an " + "AddDiscussionBoardItemSoapIn request message] the protocol server " + "responds with an AddDiscussionBoardItemSoapOut response message."); // Verify R1577 // 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( 1577, @"[AddDiscussionBoardItemSoapOut]The SOAP Body contains an " + "AddDiscussionBoardItemResponse element."); // Verify R1581 // 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( 1581, @"[The schema of AddDiscussionBoardItemResponse is defined as:]" + @"<s:element name=""AddDiscussionBoardItemResponse""> " + @" <s:complexType> " + @" <s:sequence> " + @" <s:element name=""AddDiscussionBoardItemResult"" minOccurs=""0""> " + @" <s:complexType mixed=""true"">" + @" <s:sequence>" + @" <s:element name=""listitems"" >" + @" <s:complexType>" + @" <s:sequence>" + @" <s:any />" + @" </s:sequence>" + @" <s:anyAttribute />" + @" </s:complexType>" + @" </s:element>" + @" </s:sequence>" + @" </s:complexType>" + @" </s:element>" + @" </s:sequence>" + @" </s:complexType>" + @"</s:element>"); // Verify R330 // 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( 330, @"[In AddDiscussionBoardItem operation] [In AddDiscussionBoardItemResponse element] [In listitems field] " + "The protocol server response included in the listitems element is modeled on a persistence format as specified " + "in [MS-PRSTFR], excluding the <s:schema> element."); // Verify R334 // 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( 334, @"[In AddDiscussionBoardItem operation] [In AddDiscussionBoardItemResponse element] [In listitems field] " + "The listitems element includes attributes describing the namespaces for the persistence format"); // Verify R1584 // 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( 1584, @"[AddDiscussionBoardItemResponse]listitems contains an inner element named " + "rs:data, which is of type DataDefinition."); // Verify the requirements of the DataDefinition complex type. if (addDiscussionBoardItemResult.listitems.data != null) { this.VerifyDataDefinition(addDiscussionBoardItemResult.listitems.data); } }