Esempio n. 1
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?");
        }
Esempio n. 2
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?");
        }