CloudinaryDotNet.Test.ApiTest.WithLiteral C# (CSharp) Méthode

WithLiteral() private méthode

private WithLiteral ( ) : void
Résultat void
        public void WithLiteral()
        {
            Transformation transformation = new Transformation().IfCondition("w_lt_200").Crop("fill").Height(120).Width(80);
            string sTransform = transformation.ToString();
            Assert.AreEqual(sTransform.IndexOf("if"), 0, "should include the if parameter as the first component in the transformation string");
            Assert.AreEqual("if_w_lt_200,c_fill,h_120,w_80", sTransform, "should be proper transformation string");

            transformation = new Transformation().Crop("fill").Height(120).IfCondition("w_lt_200").Width(80);
            sTransform = transformation.ToString();
            Assert.AreEqual(sTransform.IndexOf("if"), 0, "should include the if parameter as the first component in the transformation string");
            Assert.AreEqual("if_w_lt_200,c_fill,h_120,w_80", sTransform, "components should be in proper order");

            transformation = new Transformation().IfCondition("w_lt_200").Crop("fill").Height(120).Width(80).
                                          Chain().IfCondition("w_gt_400").Crop("fit").Height(150).Width(150).
                                          Chain().Effect("sepia");
            sTransform = transformation.ToString();
            Assert.AreEqual("if_w_lt_200,c_fill,h_120,w_80/if_w_gt_400,c_fit,h_150,w_150/e_sepia", sTransform, "should allow multiple conditions when chaining transformations");
        }
ApiTest