public void Given_useHttps_is_false_it_should_create_a_new_image_using_http() { string result = Imgix.CreateImage(_imagePath, _host, false); Assert.True(result.StartsWith("http")); Assert.False(result.StartsWith("https")); }
public void Given_an_options_object_with_useHttps_false_it_should_create_a_new_image_using_http() { string result = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, _host, false)), _imagePath); Assert.True(result.StartsWith("http")); Assert.False(result.StartsWith("https")); }
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_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_no_token_the_url_should_not_be_signed() { //Arrange var image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("TestSource", "TestSourceHost")), "/users/1.png"); //Act var result = image.Width(400).Height(300); //Assert Assert.False(result.ToString().Contains("s=")); }
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_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 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 Init() { _subject = new Imgix(new ImgixOptions(new ImgixSource(_sourceName, _host))); }
public void MainFixtureInit() { Image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("sourceName", "sourceName")), "some/path/to/some/image.jpg"); }
public void Init() { _image = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, _host)), _imagePath); }
public void Given_imagePath_and_host_it_should_create_a_new_image_with_host() { string result = Imgix.CreateImage(_imagePath, _host); Assert.AreEqual(_host, new Uri(result).Host); }
public void Given_imagePath_and_host_it_should_create_a_new_image_with_path() { string result = Imgix.CreateImage(_imagePath, _host); Assert.True(result.EndsWith(_imagePath)); }
public void Given_an_options_object_and_a_path_it_should_create_a_new_image_with_the_supplied_path() { string result = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, _host)), _imagePath); Assert.True(result.EndsWith(_imagePath)); }