@@ -380,20 +380,26 @@ public void VendorLocationInstallationTest1 ()
380
380
} ,
381
381
#endif
382
382
#endregion
383
+ #region case 3 data (EMPTY vendor locations, one for maya location)
384
+ new Dictionary < string , List < string > > ( )
385
+ {
386
+ { "VENDOR_INSTALLS" , new List < string > ( ) { MayaPath ( rootDir2 , "LT2018" ) } } ,
387
+ { "VENDOR_LOCATIONS" , new List < string > ( ) { rootDir1 } } ,
388
+ { "MAYA_LOCATION" , new List < string > ( ) { MayaPath ( rootDir2 , "LT2018" , false ) } } ,
389
+ { "expectedResult" , new List < string > ( ) { 1 . ToString ( ) } } ,
390
+ { "expected3DApp" , new List < string > ( ) { 0 . ToString ( ) } }
391
+ } ,
392
+ #endregion
383
393
} ;
384
394
385
395
for ( int idx = 0 ; idx < data . Count ; idx ++ )
386
396
{
387
- List < string > vendorInstallFolders = data [ idx ] [ "VENDOR_INSTALLS" ] ;
388
- string envVendorLocations = string . Join ( ";" , data [ idx ] [ "VENDOR_LOCATIONS" ] . ToArray ( ) ) ;
389
- string envMayaLocation = data [ idx ] [ "MAYA_LOCATION" ] [ 0 ] ;
390
- int expectedResult = int . Parse ( data [ idx ] [ "expectedResult" ] [ 0 ] ) ;
391
-
397
+ List < string > vendorInstallFolders = data [ idx ] [ "VENDOR_INSTALLS" ] ;
392
398
//SetUp
393
399
//make the hierarchy for the single app path we need
394
400
VendorLocations_Setup ( vendorInstallFolders ) ;
395
401
396
- TestLocations ( envVendorLocations , envMayaLocation , expectedResult ) ;
402
+ TestLocations ( data [ idx ] ) ;
397
403
398
404
//TearDown
399
405
VendorLocations_TearDown ( vendorInstallFolders ) ;
@@ -450,19 +456,28 @@ private void SetEnvironmentVariables (string vendorLocation, string mayaLocation
450
456
}
451
457
}
452
458
453
- private void TestLocations ( string vendorLocation , string mayaLocation , int expectedResult )
459
+ private void TestLocations ( Dictionary < string , List < string > > data )
454
460
{
461
+ string envVendorLocations = string . Join ( ";" , data [ "VENDOR_LOCATIONS" ] . ToArray ( ) ) ;
462
+ string envMayaLocation = data [ "MAYA_LOCATION" ] [ 0 ] ;
463
+ int expectedResult = int . Parse ( data [ "expectedResult" ] [ 0 ] ) ;
464
+
455
465
//Mayalocation should remain a List because we want to keep using the dictionary which must be of lists (maybe should make an overload)
456
466
457
467
//Set Environment Variables
458
- SetEnvironmentVariables ( vendorLocation , mayaLocation ) ;
468
+ SetEnvironmentVariables ( envVendorLocations , envMayaLocation ) ;
459
469
460
470
//Nullify these lists so that we guarantee that FindDccInstalls will be called.
461
471
ExportSettings . instance . ClearDCCOptions ( ) ;
462
472
463
473
GUIContent [ ] options = ExportSettings . GetDCCOptions ( ) ;
464
-
465
474
Assert . AreEqual ( options . Length , expectedResult ) ;
475
+
476
+ if ( data . ContainsKey ( "expected3DApp" ) )
477
+ {
478
+ int preferred = ExportSettings . instance . GetPreferredDCCApp ( ) ;
479
+ Assert . AreEqual ( preferred , int . Parse ( data [ "expected3DApp" ] [ 0 ] ) ) ;
480
+ }
466
481
}
467
482
468
483
}
0 commit comments