Пример #1
0
        public void KrakenClient_ImageSetUploadCallBack_IsTrue()
        {
            var krakenClient = HelperFunctions.CreateWorkingClient();

            var optimizeSetUploadRequest = new OptimizeSetUploadRequest(_callbackUri);

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

            var response = krakenClient.Optimize(TestData.LocalTestImage,
                                                 optimizeSetUploadRequest
                                                 );

            var result = response.Result;

            Assert.IsTrue(result.StatusCode == HttpStatusCode.OK);
            Assert.IsTrue(result.Success);
            Assert.IsTrue(result.Body != null);
            Assert.IsTrue(!string.IsNullOrEmpty(result.Body.Id));
        }
Пример #2
0
        public static OptimizeSetUploadRequest ThatAddTheSameImageSetTwoTimes(this OptimizeSetUploadRequest optimizeSetUploadRequest)
        {
            optimizeSetUploadRequest = new OptimizeSetUploadRequest(Given.ACallBackUrl.ThatIsAValidCallBackUrl());
            optimizeSetUploadRequest.AddSet(Given.AResizeImageSet.ThatInitialResizeImageSet());
            optimizeSetUploadRequest.AddSet(Given.AResizeImageSet.ThatInitialResizeImageSet());

            return(optimizeSetUploadRequest);
        }
Пример #3
0
        public static OptimizeSetUploadRequest ThatAddsOver10ImagesSets(this OptimizeSetUploadRequest optimizeSetUploadRequest)
        {
            optimizeSetUploadRequest = new OptimizeSetUploadRequest(Given.ACallBackUrl.ThatIsAValidCallBackUrl());

            for (var i = 0; i < 11; i++)
            {
                optimizeSetUploadRequest.AddSet(Given.AResizeImageSet.ThatReturnsAvalidImageSet($"image{i}"));
            }

            return(optimizeSetUploadRequest);
        }
Пример #4
0
        public static OptimizeSetUploadRequest ThatHasASetOf3(this OptimizeSetUploadRequest optimizeSetUploadRequest)
        {
            optimizeSetUploadRequest = new OptimizeSetUploadRequest(Given.ACallBackUrl.ThatIsAValidCallBackUrl())
            {
                Lossy = true
            };

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

            return(optimizeSetUploadRequest);
        }
Пример #5
0
 public static OptimizeSetUploadRequest ThatHasAValidCallbackUrl(this OptimizeSetUploadRequest optimizeSetUploadRequest)
 {
     return(new OptimizeSetUploadRequest(Given.ACallBackUrl.ThatIsAValidCallBackUrl()));
 }