public void ToCloudinary_WithTwoTransformations_CombinesThem()
        {
            var first = new Transformation(20, 40) { Angle = new Angle(40)};
            var second = new TransformationBase
                             {
                                 Effect = "sepia"
                             };

            var chained = new ChainedTransformation(first, second);

            Assert.AreEqual("w_20,h_40,a_40/e_sepia", chained.ToCloudinary());
        }
        public void Chain_WithSeconArgumentChained_ReUsesExistsing()
        {
            var first = new TransformationBase();
            var second = new TransformationBase();

            var chained = new ChainedTransformation(first, second);

            var third = new TransformationBase();

            var combined = third.Chain(chained);

            Assert.That(combined == chained);
        }
        public void Chain_OnChainedTransformation_ReUsesExisting()
        {
            var first = new TransformationBase();
            var second = new TransformationBase();

            ChainedTransformation chained = new ChainedTransformation(first, second);

            var third = new TransformationBase();

            var combined = chained.Chain(third);

            Assert.That(combined == chained);
            Assert.That(chained.InnerTransformations.Count() == 3);
        }
        public void GetFormat_WithTwoTransformations_ReturnsFirstFormat()
        {
            var first = new TransformationBase()
                            {
                                Format = "gif"
                            };

            var second = new Transformation(20, 30)
                             {
                                 Format = "png"
                             };

            var chained = new ChainedTransformation(first, second);

            Assert.That(chained.GetFormat() == "gif");
        }
        public void CloudinaryImage_WithChainedTransformation_Chains()
        {
            var first = new Transformation(35, 99)
                            {
                                Radius = 4,
                                Format = "png"
                            };
            var second = new TransformationBase()
                             {
                                 Angle = new Angle(45)
                             };

            var chained = new ChainedTransformation(first, second);

            string url = Url.CloudinaryImage("chained", chained).ToString();

            Assert.AreEqual("http://res.cloudinary.com/test/image/upload/w_35,h_99,r_4/a_45/chained.png", url);
        }