public async Task <string[]> GetProductUri(string url) { List <string> urlsresult = new List <string>(); if (!string.IsNullOrEmpty(url)) { string[] urls = url.ToString().TrimEnd(',').Split(','); foreach (var item in urls) { try { string[] fileName = item.Split("en9grhpyzhz"); string imgUrl = imagekit.Url(new Transformation()).Path(fileName[1]).Signed(true).ExpireSeconds(200000).Generate(); urlsresult.Add(imgUrl); } catch (Exception ex) { throw; } } return(await Task.FromResult(urlsresult.ToArray())); } urlsresult.Add("assets/images/no-product-image.jpg"); urlsresult.Add("assets/images/no-product-image.jpg"); return(await Task.FromResult(urlsresult.ToArray())); }
public void Url_WithPath() { string imageURL = imagekit.Url(new Transformation()).Path(SAMPLE_PATH).Generate(); Assert.Equal(URLENDPOINT + "/default-image.jpg", imageURL); }