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)); }
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); }
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); }
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); }
public static OptimizeSetUploadRequest ThatHasAValidCallbackUrl(this OptimizeSetUploadRequest optimizeSetUploadRequest) { return(new OptimizeSetUploadRequest(Given.ACallBackUrl.ThatIsAValidCallBackUrl())); }