public TUpdateProductAttribute_Return[] updateProductAttribute(string ProductType, TUpdateProductAttribute_Input[] ProductAttributes) { object[] results = this.Invoke("updateProductAttribute", new object[] { ProductType, ProductAttributes}); return ((TUpdateProductAttribute_Return[])(results[0])); }
/// <remarks/> public System.IAsyncResult BeginupdateProductAttribute(string ProductType, TUpdateProductAttribute_Input[] ProductAttributes, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("updateProductAttribute", new object[] { ProductType, ProductAttributes}, callback, asyncState); }
/// <summary> /// test updateProductAttribute /// </summary> public void testUpdateProductAttribute() { Console.WriteLine("ProductTypeTest: testUpdateProductAttribute start"); TUpdateProductAttribute_Input in1 = new TUpdateProductAttribute_Input(); in1.Alias = ATTRIBUTE1_ALIAS; in1.IsHTML = false; in1.IsHTMLSpecified = true; in1.Position = "1"; TLocalizedValue descr1EN = new TLocalizedValue(); descr1EN.LanguageCode = "en"; descr1EN.Value = ATTRIBUTE1_DESCR_EN + "updated"; in1.Description = new TLocalizedValue[]{descr1EN}; TUpdateProductAttribute_Input in2 = new TUpdateProductAttribute_Input(); in2.Alias = ATTRIBUTE2_ALIAS; in2.IsVisible = true; in2.IsVisibleSpecified = true; TLocalizedValue name2DE = new TLocalizedValue(); name2DE.LanguageCode = "de"; name2DE.Value = ATTRIBUTE2_NAME_DE + "updated"; in2.Name = new TLocalizedValue[]{name2DE}; TUpdateProductAttribute_Input in3 = new TUpdateProductAttribute_Input(); in3.Alias = NOT_EXISTING_ALIAS; TUpdateProductAttribute_Return[] attributes = productTypeService.updateProductAttribute( NET_TEST1_PATH, new TUpdateProductAttribute_Input[]{in1, in2, in3} ); Assert.IsNotNull(attributes); Assert.AreEqual(3, attributes.Length); Assert.AreEqual(ATTRIBUTE1_ALIAS, attributes[0].Alias); Assert.IsNull(attributes[0].Error); Assert.IsTrue(attributes[0].updated); Assert.AreEqual(ATTRIBUTE2_ALIAS, attributes[1].Alias); Assert.IsNull(attributes[1].Error); Assert.IsTrue(attributes[1].updated); Assert.AreEqual(NOT_EXISTING_ALIAS, attributes[2].Alias); Assert.IsNotNull(attributes[2].Error); TGetProductAttributeInfo_Return[] attributes2 = productTypeService.getProductAttributeInfo( NET_TEST1_PATH, new String[]{ATTRIBUTE1_ALIAS, ATTRIBUTE2_ALIAS}, new String[]{"en", "de"} ); Assert.IsNotNull(attributes2); Assert.AreEqual(2, attributes2.Length); Assert.AreEqual(ATTRIBUTE1_ALIAS, attributes2[0].Alias); Assert.IsNull(attributes2[0].Error); Assert.AreEqual(ATTRIBUTE1_PATH, attributes2[0].Path); Assert.IsTrue(attributes2[0].IsVisible); Assert.IsFalse(attributes2[0].IsHTML); Assert.AreEqual(0, Int32.Parse(attributes2[0].Position) % 10); TLocalizedValue[] descriptions = attributes2[0].Description; Assert.AreEqual(2, descriptions.Length); foreach (TLocalizedValue description in descriptions) { if ("de".Equals(description.LanguageCode)) Assert.AreEqual(ATTRIBUTE1_DESCR_DE, description.Value); else if ("en".Equals(description.LanguageCode)) Assert.AreEqual(ATTRIBUTE1_DESCR_EN + "updated", description.Value); } Assert.AreEqual(ATTRIBUTE2_ALIAS, attributes2[1].Alias); Assert.IsNull(attributes2[1].Error); Assert.AreEqual(ATTRIBUTE2_PATH, attributes2[1].Path); Assert.IsTrue(attributes2[1].IsVisible); Assert.IsFalse(attributes2[1].IsHTML); Assert.AreEqual(0, Int32.Parse(attributes2[1].Position) % 10); TLocalizedValue[] names = attributes2[1].Name; Assert.AreEqual(2, names.Length); foreach (TLocalizedValue name in names) { if ("de".Equals(name.LanguageCode)) Assert.AreEqual(ATTRIBUTE2_NAME_DE + "updated", name.Value); else if ("en".Equals(name.LanguageCode)) Assert.AreEqual(ATTRIBUTE2_NAME_EN, name.Value); } Assert.IsTrue(Int32.Parse(attributes2[0].Position) < Int32.Parse(attributes2[1].Position)); Console.WriteLine("ProductTypeTest: testUpdateProductAttribute end"); }