示例#1
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing OrderDocument at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[] OrderDocumentPaths = new string[] {
                invoice_path + invoice_alias,
                packingslip_path + packingslip_alias,
                creditnote_path + creditnote_alias
            };
            ArrayList OrderDocuments_exists_out = serviceClient.exists(OrderDocumentPaths);

            TExists_Return invoice_out = (TExists_Return)OrderDocuments_exists_out.ToArray()[0];

            if (invoice_out.exists)
            {
                serviceClient.delete(new string[] { invoice_path + invoice_alias });
            }

            TExists_Return packingslip_out = (TExists_Return)OrderDocuments_exists_out.ToArray()[0];

            if (packingslip_out.exists)
            {
                serviceClient.delete(new string[] { packingslip_path + packingslip_alias });
            }

            TExists_Return creditnote_out = (TExists_Return)OrderDocuments_exists_out.ToArray()[0];

            if (creditnote_out.exists)
            {
                serviceClient.delete(new string[] { creditnote_path + creditnote_alias });
            }
        }
示例#2
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the customer does NOT exists</param>
        public void testExists(bool exists)
        {
            TExists_Return[] groups_out = customerGroupService.exists(new string[] { alias });

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

            TExists_Return group_out = groups_out[0];

            Assert.AreEqual(alias, group_out.Alias, "group alias");
            Assert.AreEqual(exists, group_out.exists, "exists?");
        }
示例#3
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the Catalog does NOT exists</param>
        public void exists(bool exists)
        {
            string[]  CatalogPaths = new string[] { full };
            ArrayList Catalogs_out = serviceClient.exists(CatalogPaths);

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

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

            Assert.AreEqual(full, Catalog_out.Path, "Catalog path");
            Assert.AreEqual(exists, Catalog_out.exists, "exists?");
        }
示例#4
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing Catalog at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[]       CatalogPaths        = new string[] { full };
            ArrayList      Catalogs_exists_out = serviceClient.exists(CatalogPaths);
            TExists_Return Catalog_exists_out  = (TExists_Return)Catalogs_exists_out.ToArray()[0];

            if (!Catalog_exists_out.exists)
            {
                return;
            }

            serviceClient.delete(CatalogPaths);
        }
示例#5
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the Product does NOT exists</param>
        public void exists(bool exists)
        {
            string[]  ProductPaths = new string[] { path + alias };
            ArrayList Products_out = serviceClient.exists(ProductPaths);

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

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

            Assert.AreEqual(path + alias, Product_out.Path, "product path");
            Assert.AreEqual(exists, Product_out.exists, "exists?");
        }
示例#6
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing Product at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[]       ProductPaths        = new string[] { path + alias };
            ArrayList      Products_exists_out = serviceClient.exists(ProductPaths);
            TExists_Return Product_exists_out  = (TExists_Return)Products_exists_out.ToArray()[0];

            if (!Product_exists_out.exists)
            {
                return;
            }

            serviceClient.delete(ProductPaths);
        }
示例#7
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the Order does NOT exists</param>
        public void exists(bool exists)
        {
            string[]  OrderPaths = new string[] { path + alias };
            ArrayList Orders_out = serviceClient.exists(OrderPaths);

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

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

            Assert.AreEqual(path + alias, Order_out.Path, "Order path");
            Assert.AreEqual(exists, Order_out.exists, "exists?");
        }
示例#8
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing Order at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[]       OrderPaths        = new string[] { path + alias };
            ArrayList      Orders_exists_out = serviceClient.exists(OrderPaths);
            TExists_Return Order_exists_out  = (TExists_Return)Orders_exists_out.ToArray()[0];

            if (!Order_exists_out.exists)
            {
                return;
            }

            serviceClient.delete(OrderPaths);
        }
示例#9
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing customer at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[]       customerPaths        = new string[] { path + alias };
            ArrayList      customers_exists_out = serviceClient.exists(customerPaths);
            TExists_Return customer_exists_out  = (TExists_Return)customers_exists_out.ToArray()[0];

            if (!customer_exists_out.exists)
            {
                return;
            }

            serviceClient.delete(customerPaths);
        }
示例#10
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the User does NOT exists</param>
        public void exists(bool exists)
        {
            string[]  UserPaths = new string[] { path + alias };
            ArrayList Users_out = serviceClient.exists(UserPaths);

            // test if exists check was successful
            Assert.AreEqual(1, Users_out.Count, "exists result set");

            TExists_Return User_out = (TExists_Return)Users_out.ToArray()[0];

            Assert.That(User_out.Path.Contains(path + alias), "user path: " + User_out.Path);
            Assert.AreEqual(exists, User_out.exists, "exists?");
        }
示例#11
0
        /// <summary>
        /// this is not an actual test.
        /// delete may existing Order at the beginning of the test suite
        /// </summary>
        public void deleteIfExists()
        {
            string[]       OrderPaths        = new string[] { path + alias };
            ArrayList      Orders_exists_out = serviceClient.exists(OrderPaths);
            TExists_Return Order_exists_out  = (TExists_Return)Orders_exists_out.ToArray()[0];

            if (Order_exists_out.exists)
            {
                Console.WriteLine("order exist. deleting it.");
                serviceClient.delete(OrderPaths);
            }
            else
            {
                Console.WriteLine("order does not exist");
            }
        }
示例#12
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the CrossSelling does NOT exists</param>
        public void testExists(bool expected)
        {
            Console.WriteLine("ProductBundleTest: testExists");

            TExists_Input productBundle = new TExists_Input();

            productBundle.Product        = product;
            productBundle.BundledProduct = bundled_product2;

            TExists_Input[]  productBundles     = new TExists_Input[] { productBundle };
            TExists_Return[] productBundles_out = productBundleService.exists(productBundles);

            // test if exists check was successful
            Assert.AreEqual(1, productBundles_out.GetLength(0), "exists result count");
            TExists_Return productBundle_out = productBundles_out[0];

            Assert.IsNull(productBundle_out.Error, "exists: no error");
            Assert.AreEqual(product, productBundle_out.Product, "Product path");
            Assert.AreEqual(expected, productBundle_out.exists, "exists?");
        }
示例#13
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the CrossSelling does NOT exists</param>
        public void testExists(bool expected)
        {
            Console.WriteLine("CrossSellingTest: testExists");

            // all cross selling types
            TExists_Input CrossSelling_in = new TExists_Input();

            CrossSelling_in.Product       = product;
            CrossSelling_in.TargetProduct = target_product;
            CrossSelling_in.Type          = "CrossSelling";
            TExists_Input[] CrossSellings = new TExists_Input[] { CrossSelling_in };

            TExists_Return[] CrossSellings_out = crossSellingService.exists(CrossSellings);

            // test if exists check was successful
            Assert.AreEqual(1, CrossSellings_out.GetLength(0), "exists result count (only CrossSelling)");

            TExists_Return CrossSelling_out = CrossSellings_out[0];

            Assert.IsNull(CrossSelling_out.Error, "exists: no error");
            Assert.AreEqual(product, CrossSelling_out.Product, "Product path");
            Assert.AreEqual(target_product, CrossSelling_out.TargetProduct, "Target product");
            Assert.AreEqual(expected, CrossSelling_out.exists, "exists?");

            // only Accessories
            CrossSelling_in               = new TExists_Input();
            CrossSelling_in.Product       = product;
            CrossSelling_in.TargetProduct = target_product;
            CrossSelling_in.Type          = "Accessory";
            CrossSellings = new TExists_Input[] { CrossSelling_in };

            CrossSellings_out = crossSellingService.exists(CrossSellings);

            Assert.AreEqual(1, CrossSellings_out.GetLength(0), "exists result count (only Accessories)");
            Assert.IsNull(CrossSelling_out.Error, "exists: no error");
            Assert.AreEqual(product, CrossSelling_out.Product, "Product path");
            Assert.AreEqual(target_product, CrossSelling_out.TargetProduct, "Target product");
            Assert.AreEqual(expected, CrossSelling_out.exists, "exists?");
        }
示例#14
0
        /// <summary>
        /// use stub to test existance of a Order via web services
        /// </summary>
        /// <param name="OrderPaths">Orders to check, Array of paths</param>
        /// <returns>ArrayList of TExists_Return</returns>
        public ArrayList exists(string[] OrderPaths)
        {
            TExists_Return[] Orders_out = stub.exists(OrderPaths);

            ArrayList result = new ArrayList();

            for (int i = 0; i < Orders_out.Length; i++)
            {
                TExists_Return Order_out = Orders_out[i];

                if (Order_out.Error == null)
                {
                    Console.WriteLine("successfully checked if Order exists: " + Order_out.Path);
                    result.Add(Order_out);
                }
                else
                {
                    Console.WriteLine("an error occured (Epages Error):\n" + Order_out.Error.Message);
                }
            }

            return(result);
        }
示例#15
0
        /// <summary>
        /// test exists method
        /// </summary>
        /// <param name="exists">if false, test is successful if the OrderDocument does NOT exists</param>
        public void exists(bool expected)
        {
            string[] OrderDocumentPaths = new string[] {
                invoice_path + invoice_alias,
                packingslip_path + packingslip_alias,
                creditnote_path + creditnote_alias
            };
            ArrayList OrderDocuments_out = serviceClient.exists(OrderDocumentPaths);

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

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

            Assert.AreEqual(expected, invoice_out.exists, "invoice created?");

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

            Assert.AreEqual(expected, packingslip_out.exists, "packingslip created?");

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

            Assert.AreEqual(expected, creditnote_out.exists, "creditnote created?");
        }