Beispiel #1
0
 public async Task <ListTransformsResult> ListTransformationsAsync(ListTransformsParams parameters)
 {
     using (var response = await Api.CallAsync(HttpMethod.Get, new UrlBuilder(Api.ApiUrlV.ResourceType("transformations").BuildUrl(), parameters.ToParamsDictionary()).ToString(), null, null, null))
     {
         return(await ListTransformsResult.Parse(response));
     }
 }
Beispiel #2
0
        public void TestListTransformations()
        {
            // should allow listing transformations

            ImageUploadParams uploadParams = new ImageUploadParams()
            {
                File            = new FileDescription(m_testImagePath),
                EagerTransforms = new List <Transformation>()
                {
                    m_simpleTransformation
                },
                Tags = m_apiTag
            };

            m_cloudinary.Upload(uploadParams);

            ListTransformsResult result = m_cloudinary.ListTransformations();

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Transformations);
            TransformDesc td = result.Transformations.Where(t => t.Name == m_simpleTransformationAsString).First();

            Assert.IsFalse(td.Named);
            Assert.IsTrue(td.Used);
        }
        public void TestListTransformationsAsync()
        {
            // should allow listing transformations

            ImageUploadParams uploadParams = new ImageUploadParams()
            {
                File            = new FileDescription(m_testImagePath),
                EagerTransforms = new List <Transformation>()
                {
                    m_simpleTransformation
                },
                Tags = m_apiTag
            };

            var uploadResult = m_cloudinary.UploadAsync(uploadParams).Result;

            ListTransformsResult result = m_cloudinary.ListTransformationsAsync(new ListTransformsParams()
            {
                MaxResults = MAX_RESULTS
            }).Result;

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Transformations);
            Assert.NotNull(result.Transformations.FirstOrDefault(t => t.Name == m_simpleTransformationAsString));
        }
        private void AssertNotEmptyListAndContainsTransformation(ListTransformsResult result, string transformation)
        {
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Transformations);

            var td = result.Transformations
                     .Where(t => t.Name == transformation)
                     .First();

            Assert.IsFalse(td.Named);
            Assert.IsTrue(td.Used);
        }
Beispiel #5
0
        public ListTransformsResult ListTransformations(ListTransformsParams parameters)
        {
            UrlBuilder urlBuilder = new UrlBuilder(
                m_api.ApiUrlV.
                ResourceType("transformations").
                BuildUrl(),
                parameters.ToParamsDictionary());

            using (HttpWebResponse response = m_api.Call(
                       HttpMethod.GET, urlBuilder.ToString(), null, null))
            {
                ListTransformsResult result = ListTransformsResult.Parse(response);
                return(result);
            }
        }
        public void TestListTransformations()
        {
            // should allow listing transformations

            ImageUploadParams uploadParams = new ImageUploadParams()
            {
                File            = new FileDescription(m_testImagePath),
                EagerTransforms = new List <Transformation>()
                {
                    new Transformation().Crop("scale").Width(100)
                },
                Tags = "transformation"
            };

            m_cloudinary.Upload(uploadParams);

            ListTransformsResult result = m_cloudinary.ListTransformations();

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Transformations);
            TransformDesc td = result.Transformations.Where(t => t.Name == "c_scale,w_100").First();

            Assert.IsTrue(td.Used);
        }