Example #1
0
        /// <summary>
        /// test upload and scale of a Product image and check if method returns a true value
        /// </summary>
        public void uploadScale()
        {
            string ProductPath = path + alias;

            // read 1st
            FileStream   fs = File.OpenRead(FileName);
            BinaryReader br = new BinaryReader(fs);

            TImageData TIFile = new TImageData();

            TIFile.FileName = FName;
            TIFile.Content  = br.ReadBytes((int)fs.Length);

            // read second
            FileStream   fs1 = File.OpenRead(FileName1);
            BinaryReader br1 = new BinaryReader(fs1);

            TImageData TIFile1 = new TImageData();

            TIFile1.FileName = FName1;
            TIFile1.Content  = br1.ReadBytes((int)fs1.Length);

            // add to structure
            TUploadScale_Input tuip = new TUploadScale_Input();

            tuip.ImageData = new TImageData[] {
                TIFile,
                TIFile1,
            };

            tuip.ImagesSlideShowString = ImagesSlideShowScale;

            TScaleParams tsp = new TScaleParams();

            tsp.SCALE_BORDER_COLOR_h = SCALE_BORDER_COLOR_h;
            tsp.SCALE_BORDER_COLOR_m = SCALE_BORDER_COLOR_m;
            tsp.SCALE_BORDER_IMAGE_h = SCALE_BORDER_IMAGE_h;
            tsp.SCALE_BORDER_IMAGE_m = SCALE_BORDER_IMAGE_m;
            tsp.SCALE_NAME_h         = SCALE_NAME_h;
            tsp.SCALE_NAME_m         = SCALE_NAME_m;
            tsp.SCALE_NAME_s         = SCALE_NAME_s;
            tsp.SCALE_SIZE_h         = SCALE_SIZE_h;
            tsp.SCALE_SIZE_m         = SCALE_SIZE_m;
            tsp.SCALE_SIZE_s         = SCALE_SIZE_s;

            TUploadScale_Return[] Files_out = productImageService.uploadscale(ProductPath, tuip, tsp);

            // test if upload was successful
            Assert.AreEqual(2, Files_out.GetLength(0), "uploadScale result set");

            TUploadScale_Return File_out = Files_out[0];

            Assert.IsTrue(File_out.WriteOK, File_out.File + " written?");
            Assert.IsTrue(File_out.ScaleOK, File_out.File + " scaled?");
        }
Example #2
0
        /// <summary>
        /// test upload of a Product image and check if method returns a true value
        /// </summary>
        public void upload()
        {
            string ProductPath = path + alias;

            // read 1st
            FileStream   fs = File.OpenRead(FileName);
            BinaryReader br = new BinaryReader(fs);

            TImageData TIFile = new TImageData();

            TIFile.FileName = FName;
            TIFile.Content  = br.ReadBytes((int)fs.Length);

            // read second
            FileStream   fs1 = File.OpenRead(FileName1);
            BinaryReader br1 = new BinaryReader(fs1);

            TImageData TIFile1 = new TImageData();

            TIFile1.FileName = FName1;
            TIFile1.Content  = br1.ReadBytes((int)fs1.Length);

            // add to structure
            TUpload_Input tuip = new TUpload_Input();

            tuip.ImageData = new TImageData[] {
                TIFile,
                TIFile1,
            };
            //Params_in.setImagesSlideShowString(ImagesSlideShowUpload);
            tuip.ImagesSlideShowString = ImagesSlideShowUpload;


            TUpload_Return[] Files_out = productImageService.upload(ProductPath, tuip);

            // test if upload was successful
            Assert.AreEqual(2, Files_out.GetLength(0), "upload result set");

            TUpload_Return File_out = Files_out[0];

            Assert.IsTrue(File_out.WriteOK, File_out.File + " written?");
        }