public void TestSignedUrl()
{
// should correctly sign a url
var api = new Api("cloudinary://a:b@test123");
var expected = "http://res.cloudinary.com/test123/image/upload/s--Ai4Znfl3--/c_crop,h_20,w_10/v1234/image.jpg";
var actual = api.UrlImgUp.Version("1234")
.Transform(new Transformation().Crop("crop").Width(10).Height(20))
.Signed(true)
.BuildUrl("image.jpg");
Assert.AreEqual(expected, actual);
expected = "http://res.cloudinary.com/test123/image/upload/s----SjmNDA--/v1234/image.jpg";
actual = api.UrlImgUp.Version("1234")
.Signed(true)
.BuildUrl("image.jpg");
Assert.AreEqual(expected, actual);
expected = "http://res.cloudinary.com/test123/image/upload/s--Ai4Znfl3--/c_crop,h_20,w_10/image.jpg";
actual = api.UrlImgUp
.Transform(new Transformation().Crop("crop").Width(10).Height(20))
.Signed(true)
.BuildUrl("image.jpg");
Assert.AreEqual(expected, actual);
expected = "http://res.cloudinary.com/test123/image/upload/s--eMXgzFAO--/c_crop,h_20,w_1/v1/image.jpg";
actual = api.UrlImgUp.Version("1")
.Transform(new Transformation().Crop("crop").Width(1).Height(20))
.Signed(true)
.BuildUrl("image.jpg");
Assert.AreEqual(expected, actual);
}