/// <summary> /// test getScalePrices() and check result against created PriceListAssignment /// </summary> /// <param name="alreadyUpdated">check result against created or updated PriceListAssignment</param> public void getScalePrices() { ArrayList PriceListAssignments_out = serviceClient.getScalePrices(new string[] { product }, new string[] { pricelist }); // test if getinfo was successful and if all data are equal to input Assert.AreEqual(1, PriceListAssignments_out.Count, "get info result set"); TGetScalePrices_Return PriceListAssignment_out = (TGetScalePrices_Return)PriceListAssignments_out.ToArray()[0]; Assert.AreEqual(product, PriceListAssignment_out.Product, "product path"); Assert.AreEqual(1, PriceListAssignment_out.PriceLists.Length, "PriceLists result set"); TPriceListScalePrice mypricelist = PriceListAssignment_out.PriceLists[0]; Assert.AreEqual(pricelist, mypricelist.PriceList, "PriceLists path"); Assert.AreEqual(scalePrices[0].Quantity, mypricelist.ScalePrices[0].Quantity, "ScalePrices Quantity"); Assert.AreEqual(scalePrices[0].Price, mypricelist.ScalePrices[0].Price, "ScalePrices Price"); Assert.AreEqual(scalePrices[1].Quantity, mypricelist.ScalePrices[1].Quantity, "ScalePrices Quantity"); Assert.AreEqual(scalePrices[1].Price, mypricelist.ScalePrices[1].Price, "ScalePrices Price"); }
/// <summary> /// use stub to get info of a ScalePrices via web services /// </summary> /// <param name="products">Array of product paths</param> /// <param name="pricelists">Array of price list paths</param> /// <returns>ArrayList of TGetValueDiscounts_Return</returns> public ArrayList getScalePrices(string[] products, string[] pricelists) { TGetScalePrices_Return[] PriceListAssignments_out = stub.getScalePrices(products, pricelists); ArrayList result = new ArrayList(); for (int i = 0; i < PriceListAssignments_out.Length; i++) { TGetScalePrices_Return PriceListAssignment_out = PriceListAssignments_out[i]; if (PriceListAssignment_out.Error == null) { Console.WriteLine("successfully retrieved ScalePrices for Product: " + PriceListAssignment_out.Product); result.Add(PriceListAssignment_out); } else { Console.WriteLine("an error occured (Epages Error):\n" + PriceListAssignment_out.Error.Message); } } return(result); }