Skip to content

Commit 826147c

Browse files
committed
Uni-33810_test_bobsfavouritedrive
1 parent e4b8990 commit 826147c

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace FbxExporters.Editor
77
{
8-
abstract class DCCIntegration
8+
public abstract class DCCIntegration
99
{
1010
public abstract string DccDisplayName { get; }
1111
public abstract string IntegrationZipPath { get; }
@@ -82,7 +82,7 @@ public static void LaunchDCCApplication(string AppPath)
8282
}
8383

8484

85-
class MayaIntegration : DCCIntegration
85+
public class MayaIntegration : DCCIntegration
8686
{
8787
public override string DccDisplayName { get { return "Maya"; } }
8888

Assets/FbxExporters/Editor/UnitTests/FbxExportSettingsTest.cs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -380,20 +380,26 @@ public void VendorLocationInstallationTest1 ()
380380
},
381381
#endif
382382
#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
383393
};
384394

385395
for (int idx = 0; idx < data.Count; idx++)
386396
{
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"];
392398
//SetUp
393399
//make the hierarchy for the single app path we need
394400
VendorLocations_Setup(vendorInstallFolders);
395401

396-
TestLocations(envVendorLocations, envMayaLocation, expectedResult);
402+
TestLocations(data[idx]);
397403

398404
//TearDown
399405
VendorLocations_TearDown(vendorInstallFolders);
@@ -450,19 +456,28 @@ private void SetEnvironmentVariables (string vendorLocation, string mayaLocation
450456
}
451457
}
452458

453-
private void TestLocations(string vendorLocation, string mayaLocation, int expectedResult)
459+
private void TestLocations(Dictionary<string,List<string>> data)
454460
{
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+
455465
//Mayalocation should remain a List because we want to keep using the dictionary which must be of lists (maybe should make an overload)
456466

457467
//Set Environment Variables
458-
SetEnvironmentVariables(vendorLocation, mayaLocation);
468+
SetEnvironmentVariables(envVendorLocations, envMayaLocation);
459469

460470
//Nullify these lists so that we guarantee that FindDccInstalls will be called.
461471
ExportSettings.instance.ClearDCCOptions();
462472

463473
GUIContent[] options = ExportSettings.GetDCCOptions();
464-
465474
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+
}
466481
}
467482

468483
}

0 commit comments

Comments
 (0)