/// <summary> /// test getCreditNotes() and check result against created OrderDocuments /// </summary> public void getCreditNotes() { string[] OrderPaths = new string[] { order }; ArrayList OrderDocuments_out = serviceClient.getCreditNotes(OrderPaths); // test if getinfo was successful and if all data are equal to input Assert.AreEqual(1, OrderDocuments_out.Count, "get info result set"); TGetCreditNotes_Return CreditNote_out = (TGetCreditNotes_Return)OrderDocuments_out.ToArray()[0]; Assert.AreEqual(order, CreditNote_out.Order, "order path"); Assert.AreEqual(1, CreditNote_out.CreditNotes.Length, "CreditNotes result set"); Assert.AreEqual(creditnote_path + creditnote_alias, CreditNote_out.CreditNotes[0], "CreditNote path"); }
/// <summary> /// use stub to get all CreditNotes of an Order via web services /// </summary> /// <param name="OrderPaths">Array of order paths</param> /// <returns>ArrayList of TGetCreditNotes_Return</returns> public ArrayList getCreditNotes(string[] OrderPaths) { TGetCreditNotes_Return[] OrderDocuments_out = stub.getCreditNotes(OrderPaths); ArrayList result = new ArrayList(); for (int i = 0; i < OrderDocuments_out.Length; i++) { TGetCreditNotes_Return OrderDocument_out = OrderDocuments_out[i]; if (OrderDocument_out.Error == null) { Console.WriteLine("successfully retrieved CreditNotes of Order: " + OrderDocument_out.Order); result.Add(OrderDocument_out); } else { Console.WriteLine("an error occured (Epages Error):\n" + OrderDocument_out.Error.Message); } } return(result); }