コード例 #1
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
            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"));
            }
コード例 #2
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
            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"));
            }
コード例 #3
0
        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");
        }
コード例 #4
0
        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");
        }
コード例 #5
0
            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");
            }
コード例 #6
0
        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="));
        }
コード例 #7
0
        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");
        }
コード例 #8
0
            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");
            }
コード例 #9
0
        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");
        }
コード例 #10
0
ファイル: ImgixTests.cs プロジェクト: estei/Imgix-Dotnet
 public void Init()
 {
     _subject = new Imgix(new ImgixOptions(new ImgixSource(_sourceName, _host)));
 }
コード例 #11
0
 public void MainFixtureInit()
 {
     Image = Imgix.CreateImage(new ImgixOptions(new ImgixSource("sourceName", "sourceName")), "some/path/to/some/image.jpg");
 }
コード例 #12
0
 public void Init()
 {
     _image = Imgix.CreateImage(new ImgixOptions(new ImgixSource(_sourceName, _host)), _imagePath);
 }
コード例 #13
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
 public void Init()
 {
     _subject = new Imgix(new ImgixOptions(new ImgixSource(_sourceName, _host)));
 }
コード例 #14
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
            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);
            }
コード例 #15
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
            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));
            }
コード例 #16
0
ファイル: ImgixTests.cs プロジェクト: nadjibus/Imgix-Dotnet
            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));
            }