Пример #1
0
        public static OptimizeSetUploadWaitRequest ThatHasASetOf3(this OptimizeSetUploadWaitRequest optimizeSetUploadWaitRequest)
        {
            optimizeSetUploadWaitRequest = new OptimizeSetUploadWaitRequest()
            {
                Lossy = true
            };

            optimizeSetUploadWaitRequest.AddSet(new ResizeImageSet {
                Name = "test1", Height = 10, Width = 10
            });
            optimizeSetUploadWaitRequest.AddSet(new ResizeImageSet {
                Name = "test2", Height = 15, Width = 15
            });
            optimizeSetUploadWaitRequest.AddSet(new ResizeImageSet {
                Name = "test3", Height = 20, Width = 20
            });

            return(optimizeSetUploadWaitRequest);
        }
Пример #2
0
 public static OptimizeSetUploadWaitRequest ThatHasASetOf2WithCustomSettings(this OptimizeSetUploadWaitRequest optimizeSetUploadWaitRequest)
 {
     optimizeSetUploadWaitRequest = new OptimizeSetUploadWaitRequest()
     {
         Lossy = true
     };
     optimizeSetUploadWaitRequest.AddSet(new ResizeImageSet
     {
         Name   = "test1",
         Height = 10,
         Width  = 10,
         Lossy  = false
     });
     optimizeSetUploadWaitRequest.AddSet(new ResizeImageSet
     {
         Name           = "test2",
         Height         = 15,
         Width          = 15,
         SamplingScheme = SamplingScheme.S444
     });
     return(optimizeSetUploadWaitRequest);
 }
Пример #3
0
        public void KrakenClient_ImageSetUploadWait_IsTrue()
        {
            var krakenClient = HelperFunctions.CreateWorkingClient();

            var optimizeSetUploadWaitRequest = new OptimizeSetUploadWaitRequest();

            optimizeSetUploadWaitRequest.AddSet(new SetResizeImage {
                Name = "test1", Height = 10, Width = 10
            });
            optimizeSetUploadWaitRequest.AddSet(new SetResizeImage {
                Name = "test2", Height = 15, Width = 15
            });
            optimizeSetUploadWaitRequest.AddSet(new SetResizeImage {
                Name = "test3", Height = 20, Width = 20
            });

            var response = krakenClient.OptimizeWait(TestData.LocalTestImage,
                                                     optimizeSetUploadWaitRequest
                                                     );

            var result = response.Result;

            Assert.IsTrue(result.StatusCode == HttpStatusCode.OK);
            Assert.IsTrue(result.Success);
            Assert.IsTrue(result.Body != null);

            Assert.IsTrue(result.Body.Results.Count == 3);

            foreach (var item in result.Body.Results)
            {
                Assert.IsTrue(!string.IsNullOrEmpty(item.FileName));
                Assert.IsTrue(item.KrakedSize > 0);
                Assert.IsTrue(!string.IsNullOrEmpty(item.KrakedUrl));
                Assert.IsTrue(item.OriginalSize > 0);
                Assert.IsTrue(item.SavedBytes > 0);
            }
        }