Beispiel #1
0
        /// <summary>
        /// create a product bundle and check if the creation was successful
        /// </summary>
        public void testCreate()
        {
            Console.WriteLine("ProductBundleTest: testCreate");

            TBundledProduct bundledProduct = new TBundledProduct();

            bundledProduct.Path     = bundled_product;
            bundledProduct.Position = "10";
            bundledProduct.Quantity = 3;
            TBundledProduct bundledProduct2 = new TBundledProduct();

            bundledProduct2.Path     = bundled_product2;
            bundledProduct2.Position = "20";
            bundledProduct2.Quantity = 1;
            TBundledProduct[] bundledProducts = new TBundledProduct[] { bundledProduct, bundledProduct2 };

            TCreate_Input productBundle = new TCreate_Input();

            productBundle.Product         = product;
            productBundle.BundledProducts = bundledProducts;

            TCreate_Input[]  productBundles     = new TCreate_Input[] { productBundle };
            TCreate_Return[] productBundles_out = productBundleService.create(productBundles);

            // test if creation was successful
            Assert.AreEqual(1, productBundles_out.GetLength(0), "create result count");
            TCreate_Return productBundle_out = productBundles_out[0];

            Assert.IsNull(productBundle_out.Error, "create: no error");
            Assert.IsTrue(productBundle_out.created, "created?");
            Assert.AreEqual(product, productBundle_out.Product, "Product path");
        }
Beispiel #2
0
        private ArrayList createTestProducts(string[] aliases)
        {
            List <TCreate_Input> products = new List <TCreate_Input>();

            foreach (string alias in aliases)
            {
                TCreate_Input product = new TCreate_Input();

                product.Alias      = alias;
                product.StockLevel = 1;

                TLocalizedValue name = new TLocalizedValue();
                name.LanguageCode = "de";
                name.Value        = "DotNotTestProduct " + alias;
                product.Name      = new TLocalizedValue[] { name };

                TProductPrice price = new TProductPrice();
                price.Price           = (float)123;
                price.CurrencyID      = "EUR";
                price.TaxModel        = "gross";
                product.ProductPrices = new TProductPrice[] { price };

                products.Add(product);
            }

            return(productServiceClient.create(products.ToArray()));
        }
Beispiel #3
0
        /// <summary>
        /// test creation of a OrderDocument and check if method returns a true value
        /// </summary>
        public void create()
        {
            TCreate_Input[] OrderDocuments = new TCreate_Input[] {
                invoice_in,
                packingslip_in,
                creditnote_in
            };

            ArrayList OrderDocuments_out = serviceClient.create(OrderDocuments);

            // test if creation was successful
            Assert.AreEqual(3, OrderDocuments_out.Count, "create result set");

            TCreate_Return invoice_out = (TCreate_Return)OrderDocuments_out.ToArray()[0];

            Assert.AreEqual(order, invoice_out.Order, "Order path");
            Assert.AreEqual(true, invoice_out.created, "invoice created?");

            TCreate_Return packingslip_out = (TCreate_Return)OrderDocuments_out.ToArray()[1];

            Assert.AreEqual(order, packingslip_out.Order, "Order path");
            Assert.AreEqual(true, packingslip_out.created, "packingslip created?");

            TCreate_Return creditnote_out = (TCreate_Return)OrderDocuments_out.ToArray()[2];

            Assert.AreEqual(order, creditnote_out.Order, "Order path");
            Assert.AreEqual(true, creditnote_out.created, "creditnote created?");
        }
Beispiel #4
0
        /**
         * Create a Catalog and check if the creation was successful
         */
        public void testCreate()
        {
            TCreate_Input[]  Catalogs_in  = new TCreate_Input[] { Catalog_in };
            TCreate_Return[] Catalogs_out = catalogService.create(Catalogs_in);

            // test if creation was successful
            Assert.AreEqual(1, Catalogs_out.GetLength(0), "create result set");
            Assert.IsTrue(Catalogs_out[0].created, "created?");
        }
Beispiel #5
0
        /// <summary>
        /// test creation of a Catalog and check if method returns a true value
        /// </summary>
        public void create()
        {
            TCreate_Input[] Catalogs = new TCreate_Input[] { Catalog_in };

            ArrayList Catalogs_out = serviceClient.create(Catalogs);

            // test if creation was successful
            Assert.AreEqual(1, Catalogs_out.Count, "create result set");

            TCreate_Return Catalog_out = (TCreate_Return)Catalogs_out.ToArray()[0];

            Assert.AreEqual(alias, Catalog_out.Alias, "Catalog alias");
            Assert.AreEqual(true, Catalog_out.created, "created?");
        }
Beispiel #6
0
        /// <summary>
        /// test creation of a Product and check if method returns a true value
        /// </summary>
        public void create()
        {
            TCreate_Input[] Products = new TCreate_Input[] { Product_in };

            ArrayList Products_out = serviceClient.create(Products);

            // test if creation was successful
            Assert.AreEqual(1, Products_out.Count, "create result set");

            TCreate_Return Product_out = (TCreate_Return)Products_out.ToArray()[0];

            Assert.AreEqual(alias, Product_out.Alias, "product alias");
            Assert.AreEqual(true, Product_out.created, "created?");
        }
Beispiel #7
0
        /// <summary>
        /// test creation of a Order and check if method returns a true value
        /// </summary>
        public void create()
        {
            TCreate_Input[] Orders = new TCreate_Input[] { Order_in };

            ArrayList Orders_out = serviceClient.create(Orders);

            // test if creation was successful
            Assert.AreEqual(1, Orders_out.Count, "create result set");

            TCreate_Return Order_out = (TCreate_Return)Orders_out.ToArray()[0];

            Assert.AreEqual(alias, Order_out.Alias, "Order alias");
            Assert.AreEqual(true, Order_out.created, "created?");
        }
Beispiel #8
0
        /// <summary>
        /// test creation of a customer group and check if method returns a true value
        /// </summary>
        public void testCreate()
        {
            TCreate_Input[] groups = new TCreate_Input[] { group_in };

            TCreate_Return[] groups_out = customerGroupService.create(groups);

            // test if creation was successful
            Assert.AreEqual(1, groups_out.Length, "create result set");

            TCreate_Return group_out = groups_out[0];

            Assert.AreEqual(alias, group_out.Alias, "customer alias");
            Assert.AreEqual(true, group_out.created, "created?");
        }
        /// <summary>
        /// test create
        /// </summary>
        public void testCreate()
        {
            Console.WriteLine("ProductTypeTest: testCreate start");

            TCreate_Input create1 = new TCreate_Input();

            create1.Alias = NET_TEST1_ALIAS;
            create1.LayoutContentBundles = NET_TEST1_LAYOUT_BUNDLES;
            TLocalizedValue name1_de = new TLocalizedValue();

            name1_de.LanguageCode = "de";
            name1_de.Value        = NET_TEST1_NAME_DE;
            TLocalizedValue name1_en = new TLocalizedValue();

            name1_en.LanguageCode = "en";
            name1_en.Value        = NET_TEST1_NAME_EN;
            create1.Name          = new TLocalizedValue[] { name1_de, name1_en };

            TCreate_Input create2 = new TCreate_Input();

            create2.Alias             = NET_TEST2_ALIAS;
            create2.LayoutContentBase = NET_TEST2_LAYOUT_BASE;
            TLocalizedValue name2_de = new TLocalizedValue();

            name2_de.LanguageCode = "de";
            name2_de.Value        = NET_TEST2_NAME_DE;
            TLocalizedValue name2_en = new TLocalizedValue();

            name2_en.LanguageCode = "en";
            name2_en.Value        = NET_TEST2_NAME_EN;
            create2.Name          = new TLocalizedValue[] { name2_de, name2_en };

            TCreate_Input[]  createProductTypes = new TCreate_Input[] { create1, create2 };
            TCreate_Return[] productTypes       = productTypeService.create(createProductTypes);

            Assert.AreEqual(createProductTypes.Length, productTypes.Length);

            Assert.AreEqual(NET_TEST1_ALIAS, productTypes[0].Alias);
            Assert.IsNull(productTypes[0].Error);
            Assert.IsTrue(productTypes[0].created);
            Assert.AreEqual(NET_TEST1_PATH, productTypes[0].Path);

            Assert.AreEqual(NET_TEST2_ALIAS, productTypes[1].Alias);
            Assert.IsNull(productTypes[1].Error);
            Assert.IsTrue(productTypes[1].created);
            Assert.AreEqual(NET_TEST2_PATH, productTypes[1].Path);

            Console.WriteLine("ProductTypeTest: testCreate end");
        }
        /// <summary>
        /// insert a cross selling and check if the creation was successful
        /// </summary>
        public void testInsert()
        {
            Console.WriteLine("CrossSellingTest: testInsert");

            // insert a CrossSelling, a ProductComparison and an Accessory product
            TCreate_Input crossSelling = new TCreate_Input();

            crossSelling.Product       = product;
            crossSelling.TargetProduct = target_product;
            crossSelling.Type          = "CrossSelling";
            crossSelling.Position      = "10";
            crossSelling.Comment       = Comment1;

            TCreate_Input productComparison = new TCreate_Input();

            productComparison.Product       = product;
            productComparison.TargetProduct = target_product;
            productComparison.Type          = "ProductComparison";
            productComparison.Position      = "10";

            TCreate_Input accessory = new TCreate_Input();

            accessory.Product       = product;
            accessory.TargetProduct = target_product;
            accessory.Type          = "Accessory";
            accessory.Position      = "10";

            TCreate_Input[] CrossSellings = new TCreate_Input[] {
                crossSelling,
                productComparison,
                accessory,
            };

            TCreate_Return[] CrossSellings_out = crossSellingService.create(CrossSellings);

            // test if creation was successful
            Assert.AreEqual(3, CrossSellings_out.GetLength(0), "insert result count");
            TCreate_Return CrossSelling_out = CrossSellings_out[0];

            Assert.IsNull(CrossSelling_out.Error, "insert: no error");
            Assert.IsTrue(CrossSelling_out.created, "assigned?");
            Assert.AreEqual(product, CrossSelling_out.Product, "Product path");
            Assert.AreEqual("CrossSelling", CrossSelling_out.Type, "CrossSelling type");
        }
Beispiel #11
0
        public void Init()
        {
            // set up the ProductImageService
            productImageService                 = new ProductImageService();
            productImageService.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
            productImageService.PreAuthenticate = true;
            productImageService.Url             = WEBSERVICE_URL;

            // set up the ProductService in order to create a test product
            productService                 = new ProductService();
            productService.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
            productService.PreAuthenticate = true;
            productService.Url             = WEBSERVICE_URL;

            // create the test product
            TCreate_Input productInfo = new TCreate_Input();

            productInfo.Alias = alias;
            TCreate_Input[] createInput = new TCreate_Input[] { productInfo };
            productService.create(createInput);
        }
		/// <summary>
		/// use stub to create a OrderDocument via web services
		/// </summary>
		/// <param name="OrderDocuments">Array of TCreate_Input</param>
		/// <returns>ArrayList of TCreate_Return</returns>
		public ArrayList create(TCreate_Input[] OrderDocuments) 
		{
			TCreate_Return[] OrderDocuments_out = stub.create(OrderDocuments);

			ArrayList result = new ArrayList();

			for(int i = 0; i < OrderDocuments_out.Length; i++)
			{
				TCreate_Return OrderDocument_out = OrderDocuments_out[i];

				if (OrderDocument_out.Error == null) 
				{
					Console.WriteLine("successfully created OrderDocument: " + OrderDocument_out.Path);
					result.Add(OrderDocument_out);
				} 
				else 
				{
					Console.WriteLine("an error occured (Epages Error):\n" + OrderDocument_out.Error.Message);
				}
			}

			return result;
		}
		/// <summary>
		/// test creation of a OrderDocument and check if method returns a true value
		/// </summary>
		public void create()
		{
			TCreate_Input[] OrderDocuments = new TCreate_Input[]{
																	invoice_in,
																	packingslip_in,
																	creditnote_in
																};

			ArrayList OrderDocuments_out = serviceClient.create(OrderDocuments);

			// test if creation was successful
			Assert.AreEqual(3, OrderDocuments_out.Count, "create result set");

			TCreate_Return invoice_out = (TCreate_Return)OrderDocuments_out.ToArray()[0];
			Assert.AreEqual(order, invoice_out.Order, "Order path");
			Assert.AreEqual(true, invoice_out.created, "invoice created?");

			TCreate_Return packingslip_out = (TCreate_Return)OrderDocuments_out.ToArray()[1];
			Assert.AreEqual(order, packingslip_out.Order, "Order path");
			Assert.AreEqual(true, packingslip_out.created, "packingslip created?");
		
			TCreate_Return creditnote_out = (TCreate_Return)OrderDocuments_out.ToArray()[2];
			Assert.AreEqual(order, creditnote_out.Order, "Order path");
			Assert.AreEqual(true, creditnote_out.created, "creditnote created?");
		}