@@ -25,27 +25,88 @@ void LogNonEmptyString(string name, string str) {
25
25
Assert . IsFalse ( string . IsNullOrEmpty ( str ) ) ;
26
26
}
27
27
28
+ /// <summary>
29
+ /// Checks if the given text contains "mayalt" as one word.
30
+ /// </summary>
31
+ /// <param name="text">Text.</param>
32
+ void ContainsMayaLT ( string text ) {
33
+ Assert . IsFalse ( string . IsNullOrEmpty ( text ) ) ;
34
+ Assert . IsTrue ( text . ToLower ( ) . Contains ( "mayalt" ) ) ;
35
+ }
36
+
28
37
[ Test ]
29
38
public void BasicTest ( ) {
30
- Assert . IsFalse ( Editor . MayaIntegration . IsHeadlessInstall ( ) ) ;
31
-
32
- LogNonEmptyString ( "module path" , Editor . MayaIntegration . GetModulePath ( ) ) ;
33
- LogNonEmptyString ( "module template path" , Editor . MayaIntegration . GetModuleTemplatePath ( ) ) ;
34
-
35
- LogNonEmptyString ( "app path" , Editor . MayaIntegration . GetAppPath ( ) ) ;
36
- LogNonEmptyString ( "project path" , Editor . MayaIntegration . GetProjectPath ( ) ) ;
37
- LogNonEmptyString ( "package path" , Editor . MayaIntegration . GetPackagePath ( ) ) ;
38
- LogNonEmptyString ( "package version" , Editor . MayaIntegration . GetPackageVersion ( ) ) ;
39
- LogNonEmptyString ( "temp path" , Editor . MayaIntegration . GetTempSavePath ( ) ) ;
40
- LogNonEmptyString ( "export settings path" , Editor . MayaIntegration . GetExportSettingsPath ( ) ) ;
41
- LogNonEmptyString ( "instruction path" , Editor . MayaIntegration . GetMayaInstructionPath ( ) ) ;
42
- LogNonEmptyString ( "full instruction path" , Editor . MayaIntegration . GetFullMayaInstructionPath ( ) ) ;
43
-
44
- // test that the paths don't contain backslashes
45
- Assert . IsFalse ( Editor . MayaIntegration . GetAppPath ( ) . Contains ( "\\ " ) ) ;
46
- Assert . IsFalse ( Editor . MayaIntegration . GetProjectPath ( ) . Contains ( "\\ " ) ) ;
47
- Assert . IsFalse ( Editor . MayaIntegration . GetTempSavePath ( ) . Contains ( "\\ " ) ) ;
48
- Assert . IsFalse ( Editor . MayaIntegration . GetExportSettingsPath ( ) . Contains ( "\\ " ) ) ;
39
+ // test Maya integration
40
+ {
41
+ var mayaIntegration = new Editor . MayaIntegration ( ) ;
42
+
43
+ LogNonEmptyString ( "display name" , mayaIntegration . DccDisplayName ) ;
44
+ LogNonEmptyString ( "integration zip path" , mayaIntegration . IntegrationZipPath ) ;
45
+
46
+ Assert . IsFalse ( Editor . MayaIntegration . IsHeadlessInstall ( ) ) ;
47
+
48
+ LogNonEmptyString ( "module template path" , mayaIntegration . GetModuleTemplatePath ( ) ) ;
49
+ LogNonEmptyString ( "app path" , Editor . MayaIntegration . GetAppPath ( ) ) ;
50
+ LogNonEmptyString ( "package path" , Editor . MayaIntegration . GetPackagePath ( ) ) ;
51
+ LogNonEmptyString ( "temp path" , Editor . MayaIntegration . GetTempSavePath ( ) ) ;
52
+ LogNonEmptyString ( "instruction path" , Editor . MayaIntegration . GetMayaInstructionPath ( ) ) ;
53
+ LogNonEmptyString ( "full instruction path" , Editor . MayaIntegration . GetFullMayaInstructionPath ( ) ) ;
54
+
55
+ // make sure the path is absolute
56
+ Assert . IsTrue ( System . IO . Path . IsPathRooted ( Editor . MayaIntegration . GetFullMayaInstructionPath ( ) ) ) ;
57
+
58
+ LogNonEmptyString ( "export settings path" , mayaIntegration . GetExportSettingsPath ( ) ) ;
59
+ LogNonEmptyString ( "package version" , Editor . MayaIntegration . GetPackageVersion ( ) ) ;
60
+
61
+ // check if folder is unzipped at invalid paths
62
+ Assert . IsFalse ( mayaIntegration . FolderAlreadyUnzippedAtPath ( null ) ) ;
63
+ Assert . IsFalse ( mayaIntegration . FolderAlreadyUnzippedAtPath ( "" ) ) ;
64
+ Assert . IsFalse ( mayaIntegration . FolderAlreadyUnzippedAtPath ( "X:/a/b/a/c" ) ) ;
65
+
66
+ // test that the paths don't contain backslashes
67
+ Assert . IsFalse ( Editor . MayaIntegration . GetAppPath ( ) . Contains ( "\\ " ) ) ;
68
+ Assert . IsFalse ( Editor . MayaIntegration . GetProjectPath ( ) . Contains ( "\\ " ) ) ;
69
+ Assert . IsFalse ( Editor . MayaIntegration . GetTempSavePath ( ) . Contains ( "\\ " ) ) ;
70
+ Assert . IsFalse ( mayaIntegration . GetExportSettingsPath ( ) . Contains ( "\\ " ) ) ;
71
+ Assert . IsFalse ( Editor . MayaIntegration . GetMayaInstructionPath ( ) . Contains ( "\\ " ) ) ;
72
+ Assert . IsFalse ( Editor . MayaIntegration . GetFullMayaInstructionPath ( ) . Contains ( "\\ " ) ) ;
73
+ }
74
+
75
+ // test Maya LT integration
76
+ {
77
+ var mayaLTIntegration = new Editor . MayaLTIntegration ( ) ;
78
+
79
+ // make sure that the values we get are for Maya LT since it inherits a lot from Maya Integration
80
+ Assert . AreEqual ( "Maya LT" , mayaLTIntegration . DccDisplayName ) ;
81
+ ContainsMayaLT ( mayaLTIntegration . IntegrationZipPath ) ;
82
+
83
+ LogNonEmptyString ( "import settings path" , mayaLTIntegration . GetImportSettingsPath ( ) ) ;
84
+
85
+ ContainsMayaLT ( mayaLTIntegration . GetModuleTemplatePath ( ) ) ;
86
+ ContainsMayaLT ( mayaLTIntegration . GetExportSettingsPath ( ) ) ;
87
+
88
+ // test that the paths don't contain backslashes
89
+ Assert . IsFalse ( mayaLTIntegration . GetExportSettingsPath ( ) . Contains ( "\\ " ) ) ;
90
+ Assert . IsFalse ( mayaLTIntegration . GetImportSettingsPath ( ) . Contains ( "\\ " ) ) ;
91
+ }
92
+
93
+ // test 3ds Max integration
94
+ {
95
+ var maxIntegration = new Editor . MaxIntegration ( ) ;
96
+
97
+ LogNonEmptyString ( "display name" , maxIntegration . DccDisplayName ) ;
98
+ LogNonEmptyString ( "integration zip path" , maxIntegration . IntegrationZipPath ) ;
99
+
100
+ // check getting absolute path
101
+ var absPath = Editor . MaxIntegration . GetAbsPath ( "foo" ) ;
102
+ Assert . IsTrue ( System . IO . Path . IsPathRooted ( absPath ) ) ;
103
+ Assert . IsFalse ( absPath . Contains ( "\\ " ) ) ;
104
+
105
+ // check if folder is unzipped at invalid paths
106
+ Assert . IsFalse ( maxIntegration . FolderAlreadyUnzippedAtPath ( null ) ) ;
107
+ Assert . IsFalse ( maxIntegration . FolderAlreadyUnzippedAtPath ( "" ) ) ;
108
+ Assert . IsFalse ( maxIntegration . FolderAlreadyUnzippedAtPath ( "X:/a/b/a/c" ) ) ;
109
+ }
49
110
}
50
111
}
51
112
}
0 commit comments