@@ -494,8 +494,8 @@ public void TestEnglishText()
494494 tParams . FontStyle = "italic" ;
495495 TextResult textResult = m_cloudinary . Text ( tParams ) ;
496496
497- Assert . AreEqual ( 67 , textResult . Width ) ;
498- Assert . AreEqual ( 11 , textResult . Height ) ;
497+ Assert . IsTrue ( textResult . Width > 0 ) ;
498+ Assert . IsTrue ( textResult . Height > 0 ) ;
499499 }
500500
501501 [ Test ]
@@ -2364,7 +2364,7 @@ public void TestPostParamsInTheBody()
23642364 /// <summary>
23652365 /// Uploads test image with params specified
23662366 /// </summary>
2367- private void UploadImageForTestArchive ( string archiveTag , double width , bool useFileName )
2367+ private ImageUploadResult UploadImageForTestArchive ( string archiveTag , double width , bool useFileName )
23682368 {
23692369 ImageUploadParams uploadParams = new ImageUploadParams ( )
23702370 {
@@ -2373,7 +2373,7 @@ private void UploadImageForTestArchive(string archiveTag, double width, bool use
23732373 UseFilename = useFileName ,
23742374 Tags = archiveTag
23752375 } ;
2376- m_cloudinary . Upload ( uploadParams ) ;
2376+ return m_cloudinary . Upload ( uploadParams ) ;
23772377 }
23782378
23792379 [ Test ]
@@ -2382,23 +2382,38 @@ public void TestCreateArchive()
23822382 string archiveTag = string . Format ( "archive_tag_{0}" , UnixTimeNow ( ) ) ;
23832383 string targetPublicId = string . Format ( "archive_id_{0}" , UnixTimeNow ( ) ) ;
23842384
2385- UploadImageForTestArchive ( archiveTag , 2.0 , true ) ;
2385+ ImageUploadResult res = UploadImageForTestArchive ( archiveTag , 2.0 , true ) ;
23862386
2387- ArchiveParams parameters = new ArchiveParams ( ) . Tags ( new List < string > { archiveTag } ) . TargetPublicId ( targetPublicId ) ;
2387+ ArchiveParams parameters = new ArchiveParams ( ) . Tags ( new List < string > { archiveTag , "no_such_tag" } ) . TargetPublicId ( targetPublicId ) ;
23882388 ArchiveResult result = m_cloudinary . CreateArchive ( parameters ) ;
23892389 Assert . AreEqual ( string . Format ( "{0}.zip" , targetPublicId ) , result . PublicId ) ;
23902390 Assert . AreEqual ( 1 , result . FileCount ) ;
23912391
2392- UploadImageForTestArchive ( archiveTag , 500 , false ) ;
2392+ ImageUploadResult res2 = UploadImageForTestArchive ( archiveTag , 500 , false ) ;
23932393
2394- parameters = new ArchiveParams ( ) . Tags ( new List < string > { archiveTag } )
2394+ parameters = new ArchiveParams ( ) . PublicIds ( new List < string > { res . PublicId , res2 . PublicId } )
23952395 . Transformations ( new List < Transformation > { new Transformation ( ) . Width ( "0.5" ) , new Transformation ( ) . Width ( 2 ) } )
23962396 . FlattenFolders ( true )
23972397 . UseOriginalFilename ( true ) ;
23982398 result = m_cloudinary . CreateArchive ( parameters ) ;
23992399 Assert . AreEqual ( 2 , result . FileCount ) ;
24002400 }
24012401
2402+ [ Test ]
2403+ public void TestCreateArchiveMultiplePublicIds ( )
2404+ {
2405+ // should support archiving based on multiple public IDs
2406+ string archiveTag = string . Format ( "archive_tag_{0}" , UnixTimeNow ( ) ) ;
2407+ string targetPublicId = string . Format ( "archive_id_{0}" , UnixTimeNow ( ) ) ;
2408+
2409+ UploadImageForTestArchive ( archiveTag , 2.0 , true ) ;
2410+
2411+ ArchiveParams parameters = new ArchiveParams ( ) . Tags ( new List < string > { archiveTag , "sadf" } ) . TargetPublicId ( targetPublicId ) ;
2412+ ArchiveResult result = m_cloudinary . CreateArchive ( parameters ) ;
2413+ Assert . AreEqual ( string . Format ( "{0}.zip" , targetPublicId ) , result . PublicId ) ;
2414+ Assert . AreEqual ( 1 , result . FileCount ) ;
2415+ }
2416+
24022417 [ Test ]
24032418 public void TestDownloadArchive ( )
24042419 {
0 commit comments