public void Should_sign_the_image_if_token_is_set() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, "FOO123bar", _host, true)), "/users/1.png"); //Act //Assert ImgixImageAsserts.HasQueryParameter(image, "s", "6797c24146142d5b40bde3141fd3600c"); }
public void Given_a_simple_path_it_should_sign_the_url_correctly() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("TestSource", "FOO123bar", "TestSource")), "/users/1.png"); //Act //Assert ImgixImageAsserts.HasQueryParameter(image, "s", "6797c24146142d5b40bde3141fd3600c"); }
public void Given_A_fully_qualified_url_in_path_it_should_sign_the_url_correctly() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("TestSource", "FOO123bar", "TestSource")), "http://avatars.com/john-smith.png"); //Act //Assert ImgixImageAsserts.HasQueryParameter(image, "s", "493a52f008c91416351f8b33d4883135"); }
public void Should_add_parameter_to_new_image_object() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, _host)), _imagePath); //Act var result = image.AddParameter("test1", "test1"); //Assert ImgixImageAsserts.HasQueryParameter(result, "test1", "test1"); }
public void Should_add_a_query_parameter_called_w_with_the_given_integer_value() { //Arrange const int width = 200; //Act var result = Image.Width(width); //Assert ImgixImageAsserts.HasQueryParameter(result, "w", width.ToString()); }
public void Should_add_a_query_parameter_called_h_with_the_given_float_value() { //Arrange const string height = "0.9"; //Act var result = Image.Height(height); //Assert ImgixImageAsserts.HasQueryParameter(result, "h", height); }
public void Should_add_a_query_parameter_called_h_with_the_given_float_value() { //Arrange var height = 0.9; //Act var result = Image.Height(height); //Assert ImgixImageAsserts.HasQueryParameter(result, "h", height.ToString(CultureInfo.InvariantCulture)); }
public void Should_add_a_query_parameter_called_h_with_the_given_integer_value() { //Arrange var height = 200; //Act var result = Image.Height(height); //Assert ImgixImageAsserts.HasQueryParameter(result, "h", height.ToString()); }
public void Should_add_a_query_parameter_called_fit_with_the_given_string_value() { //Arrange const string fit = "clip"; //Act var result = Image.Fit(fit); //Assert ImgixImageAsserts.HasQueryParameter(result, "fit", fit); }
public void Should_add_a_query_parameter_called_crop_with_the_given_string_value() { //Arrange const string crop = "top"; //Act var result = Image.Crop(crop); //Assert ImgixImageAsserts.HasQueryParameter(result, "crop", crop); }
public void Should_add_a_query_parameter_called_rect_with_value_from_dimensions() { //Arrange const string dimensions = "0,0,200,200"; //Act var result = Image.Rect(dimensions); //Assert ImgixImageAsserts.HasQueryParameter(result, "rect", dimensions); }
public void Given_a_simple_path_with_width_and_height_it_should_sign_the_url_correctly() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("TestSource", "FOO123bar", "TestSource")), "/users/1.png"); //Act var result = image.Width(400).Height(300); //Assert ImgixImageAsserts.HasQueryParameter(result, "s", "c7b86f666a832434dd38577e38cf86d1"); }
public void Should_add_a_query_parameter_called_w_with_the_given_float_value() { //Arrange const double width = 0.9; //Act var result = Image.Width(width); //Assert ImgixImageAsserts.HasQueryParameter(result, "w", width.ToString(CultureInfo.InvariantCulture)); }
public void Should_add_a_query_parameter_called_w_with_the_given_string_value() { //Arrange const string width = "0.9"; //Act var result = Image.Width(width); //Assert ImgixImageAsserts.HasQueryParameter(result, "w", width); }
public void Given_A_fully_qualified_url_in_path_and_a_width_and_a_height_it_should_sign_the_url_correctly() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("TestSource", "FOO123bar", "TestSource")), "http://avatars.com/john-smith.png"); //Act var result = image.Width(400).Height(300); //Assert ImgixImageAsserts.HasQueryParameter(result, "s", "61ea1cc7add87653bb0695fe25f2b534"); }
public void Should_add_a_query_parameter_called_rect_with_values_given() { //Arrange const int x = 100; const int y = 50; const int width = 200; const int height = 200; var expectedDimensions = $"{x},{y},{width},{height}"; //Act var result = Image.Rect(x, y, width, height); //Assert ImgixImageAsserts.HasQueryParameter(result, "rect", expectedDimensions); }
public void Given_an_integer_it_should_add_a_px_parameter_with_the_integer_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Pixellate(50), "px", "50"); }
public void Given_an_integer_it_should_add_a_parameter_page_with_the_value_of_the_integer() { ImgixImageAsserts.HasQueryParameter(Image.Page(1), "page", "1"); }
public void Given_a_string_it_will_add_a_parameter_border_with_the_string_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Border("border=10,000"), "border", "border=10,000"); }
public void Given_multiple_AutoTransform_it_will_add_them_all_seperated_by_commas() { ImgixImageAsserts.HasQueryParameter(Image.Auto(AutoOperation.Format, AutoOperation.Redeye), "auto", "format,redeye"); }
public void Given_an_AutoTransform_Format_an_auto_parameter_format_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Auto(AutoOperation.Format), "auto", "format"); }
public void It_should_add_a_mask_parameter_with_the_value_ellipse() { ImgixImageAsserts.HasQueryParameter(Image.EllipseMask(), "mask", "ellipse"); }
public void Given_an_AutoTransform_Enhance_an_auto_parameter_enhance_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Auto(AutoOperation.Enhance), "auto", "enhance"); }
public void Given_a_string_an_auto_parameter_is_added_with_the_string_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Auto("enhance"), "auto", "enhance"); }
public void Given_a_string_it_will_add_a_parameter_prefix_with_the_value_of_the_string() { ImgixImageAsserts.HasQueryParameter(Image.CSSPrefix("ThisIsAPrefix"), "prefix", "ThisIsAPrefix"); }
public void Given_a_string_it_will_add_a_parameter_palette_with_the_value_of_the_string() { ImgixImageAsserts.HasQueryParameter(Image.Palette("json"), "palette", "json"); }
public void Given_an_integer_it_should_add_a_parameter_colors_with_the_value_of_the_integer() { ImgixImageAsserts.HasQueryParameter(Image.Colors(1), "colors", "1"); }
public void Given_an_AutoTransform_Redeye_an_auto_parameter_redeye_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Auto(AutoOperation.Redeye), "auto", "redeye"); }
public void Given_a_string_it_should_add_a_parameter_mask_with_the_string_as_value() { ImgixImageAsserts.HasQueryParameter(Image.Mask("some/path/or/url.jpg?"), "mask", "some/path/or/url.jpg?"); }
public void Given_an_integer_it_should_add_a_sepia_parameter_with_the_integer_as_value() { ImgixImageAsserts.HasQueryParameter(Image.SepiaTone(50), "sepia", "50"); }