Skip to content

Commit 1ac319c

Browse files
committed
fix unit test namespace references
1 parent 75a4751 commit 1ac319c

12 files changed

+34
-62
lines changed

Assets/com.unity.formats.fbx.tests/ConvertToModelTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using UnityEngine;
2-
using UnityEditor;
32
using NUnit.Framework;
43
using System.Collections.Generic;
54
using System.IO;
6-
using UnityEditor.Formats.Fbx.Exporter;
5+
using UnityEngine.Formats.Fbx.Exporter;
76

87
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
98
{

Assets/com.unity.formats.fbx.tests/CustomExtensionsTest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
//#define DEBUG_UNITTEST
44

55
using UnityEngine;
6-
using UnityEditor;
76
using NUnit.Framework;
8-
using System.Collections.Generic;
9-
using System.Collections;
10-
using FbxExporters.CustomExtensions;
7+
using UnityEditor.Formats.Fbx.Exporter.CustomExtensions;
118
using UnityEngine.Formats.FbxSdk;
129

1310
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests

Assets/com.unity.formats.fbx.tests/DefaultSelectionTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
using UnityEngine;
2-
using UnityEditor;
3-
using UnityEngine.TestTools;
42
using NUnit.Framework;
5-
using System.IO;
63
using System.Collections.Generic;
74
using UnityEngine.Formats.FbxSdk;
8-
using FbxExporters.EditorTools;
95

106
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
117
{

Assets/com.unity.formats.fbx.tests/ExportPerformanceTest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using UnityEngine;
2-
using UnityEditor;
3-
using UnityEngine.TestTools;
42
using NUnit.Framework;
5-
using System.Collections;
63
using System.Diagnostics;
74

85
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
@@ -69,7 +66,7 @@ public void TestPerformance ()
6966

7067
m_stopwatch.Reset ();
7168
m_stopwatch.Start ();
72-
var fbxFileName = FbxExporters.Editor.ModelExporter.ExportObjects (filename, new Object[]{m_toExport}) as string;
69+
var fbxFileName = ModelExporter.ExportObjects (filename, new Object[]{m_toExport}) as string;
7370
m_stopwatch.Stop ();
7471

7572
UnityEngine.Debug.unityLogger.logEnabled = true;

Assets/com.unity.formats.fbx.tests/ExportTimelineClipTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using UnityEngine;
2-
using UnityEditor;
32
using NUnit.Framework;
43
using UnityEngine.Timeline;
54
using UnityEngine.Playables;

Assets/com.unity.formats.fbx.tests/ExporterTestBase.cs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using UnityEngine;
2-
using UnityEditor;
3-
using UnityEngine.TestTools;
42
using NUnit.Framework;
53
using System.IO;
6-
using UnityEngine.Formats.FbxSdk;
74

85
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
96
{
@@ -212,14 +209,14 @@ public virtual void Term ()
212209
EditorApplication.update += DeleteOnNextUpdate;
213210

214211
// Put back the initial setting for the auto-updater toggle
215-
FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled = isAutoUpdaterOn;
212+
ExportSettings.instance.autoUpdaterEnabled = isAutoUpdaterOn;
216213
}
217214

218215
[SetUp]
219216
public virtual void Init()
220217
{
221-
isAutoUpdaterOn = FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled;
222-
FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled = true;
218+
isAutoUpdaterOn = ExportSettings.instance.autoUpdaterEnabled;
219+
ExportSettings.instance.autoUpdaterEnabled = true;
223220
}
224221

225222

@@ -228,27 +225,27 @@ public virtual void Init()
228225
/// </summary>
229226
/// <returns>Root of Model Prefab.</returns>
230227
/// <param name="selected">Objects to export.</param>
231-
protected virtual GameObject ExportSelection(Object selected, EditorTools.IExportOptions exportOptions = null)
228+
protected virtual GameObject ExportSelection(Object selected, IExportOptions exportOptions = null)
232229
{
233230
// export selected to a file, then return the root
234231
var filename = GetRandomFileNamePath();
235232
return ExportSelection (filename, selected, exportOptions);
236233
}
237234

238-
protected virtual GameObject ExportSelection(Object[] selected, EditorTools.IExportOptions exportOptions = null){
235+
protected virtual GameObject ExportSelection(Object[] selected, IExportOptions exportOptions = null){
239236
var filename = GetRandomFileNamePath();
240237
return ExportSelection (filename, selected, exportOptions);
241238
}
242239

243-
protected virtual GameObject ExportSelection(string filename, Object selected, EditorTools.IExportOptions exportOptions = null)
240+
protected virtual GameObject ExportSelection(string filename, Object selected, IExportOptions exportOptions = null)
244241
{
245242
// export selected to a file, then return the root
246243
return ExportSelection (filename, new Object[]{selected}, exportOptions);
247244
}
248245

249-
protected virtual GameObject ExportSelection(string filename, Object[] selected, EditorTools.IExportOptions exportOptions = null){
246+
protected virtual GameObject ExportSelection(string filename, Object[] selected, IExportOptions exportOptions = null){
250247
Debug.unityLogger.logEnabled = false;
251-
var fbxFileName = FbxExporters.Editor.ModelExporter.ExportObjects (filename, selected, exportOptions) as string;
248+
var fbxFileName = ModelExporter.ExportObjects (filename, selected, exportOptions) as string;
252249
Debug.unityLogger.logEnabled = true;
253250

254251
Assert.IsNotNull (fbxFileName);
@@ -276,15 +273,15 @@ protected virtual GameObject ExportSelection(string filename, Object[] selected,
276273
/// <param name="animOnly">If set to <c>true</c> export animation only.</param>
277274
protected GameObject ExportToFbx (
278275
GameObject hierarchy, bool animOnly = false,
279-
EditorTools.ExportSettings.LODExportType lodExportType = EditorTools.ExportSettings.LODExportType.All
276+
ExportSettings.LODExportType lodExportType = ExportSettings.LODExportType.All
280277
){
281278
string filename = GetRandomFbxFilePath ();
282-
var exportOptions = new EditorTools.ExportModelSettingsSerialize ();
279+
var exportOptions = new ExportModelSettingsSerialize ();
283280
exportOptions.SetLODExportType(lodExportType);
284281
if (animOnly) {
285-
exportOptions.SetModelAnimIncludeOption(FbxExporters.EditorTools.ExportSettings.Include.Anim);
282+
exportOptions.SetModelAnimIncludeOption(ExportSettings.Include.Anim);
286283
}
287-
var exportedFilePath = FbxExporters.Editor.ModelExporter.ExportObject (
284+
var exportedFilePath = ModelExporter.ExportObject (
288285
filename, hierarchy, exportOptions
289286
);
290287
Assert.That (exportedFilePath, Is.EqualTo (filename));

Assets/com.unity.formats.fbx.tests/FbxAnimationTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
//#define DEBUG_UNITTEST
44

55
using UnityEngine;
6-
using UnityEditor;
76
using NUnit.Framework;
87
using System.Collections;
98
using System.Collections.Generic;
10-
using FbxExporters.Editor;
119
using System.Linq;
1210

1311
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests

Assets/com.unity.formats.fbx.tests/FbxCameraTests.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
//#define DEBUG_UNITTEST
44

55
using UnityEngine;
6-
using UnityEditor;
76
using NUnit.Framework;
8-
using System.Collections.Generic;
9-
using System.Collections;
10-
using FbxExporters.CustomExtensions;
7+
using UnityEditor.Formats.Fbx.Exporter.CustomExtensions;
118

129
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
1310
{
@@ -58,7 +55,7 @@ public void GameCameraTest()
5855

5956
// Convert it to FBX. The asset file will be deleted automatically
6057
// on termination.
61-
var fbxAsset = FbxExporters.Editor.ModelExporter.ExportObject(
58+
var fbxAsset = ModelExporter.ExportObject(
6259
filename, original);
6360

6461
// refresh the assetdata base so that we can query for the model
@@ -96,7 +93,7 @@ public void PhysicalCameraTest()
9693

9794
// Convert it to FBX. The asset file will be deleted automatically
9895
// on termination.
99-
var fbxAsset = FbxExporters.Editor.ModelExporter.ExportObject(
96+
var fbxAsset = ModelExporter.ExportObject(
10097
filename, original);
10198

10299
var source = AssetDatabase.LoadMainAssetAtPath(fbxAsset) as GameObject;

Assets/com.unity.formats.fbx.tests/FbxPrefabAutoUpdaterTest.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using System.Collections.Generic;
66
using UnityEditor.Formats.Fbx.Exporter;
7+
using UnityEngine.Formats.Fbx.Exporter;
78

89
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
910
{
@@ -117,7 +118,7 @@ public void RectTransformTest ()
117118
#endif
118119
//export our updated hierarchy to the same file path as the original
119120
SleepForFileTimestamp();
120-
FbxExporters.Editor.ModelExporter.ExportObject(filePath1, cube2);
121+
ModelExporter.ExportObject(filePath1, cube2);
121122
AssetDatabase.Refresh();
122123

123124
rectTransform = oldPrefab.transform.GetChild (0).GetComponent<RectTransform> ();
@@ -143,7 +144,7 @@ public void ReplaceTest ()
143144
// that its timestamp differs enough for Unity to notice it
144145
// changed.
145146
SleepForFileTimestamp();
146-
FbxExporters.Editor.ModelExporter.ExportObject(m_fbxPath, newHierarchy);
147+
ModelExporter.ExportObject(m_fbxPath, newHierarchy);
147148
AssetDatabase.Refresh();
148149

149150
// Verify that a new instance of the prefab got updated.
@@ -239,8 +240,8 @@ public override void Init()
239240
{
240241
base.Init();
241242
// Save the initial setting for the auto updater toggle and disable it for the unit test
242-
isAutoUpdaterOn = FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled;
243-
FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled = false;
243+
isAutoUpdaterOn = ExportSettings.instance.autoUpdaterEnabled;
244+
ExportSettings.instance.autoUpdaterEnabled = false;
244245
FbxPrefabAutoUpdater.runningUnitTest = true;
245246
}
246247

@@ -339,7 +340,7 @@ public void RemappingTest()
339340
public void stopTest()
340341
{
341342
// Put back the initial setting for the auto-updater toggle
342-
FbxExporters.EditorTools.ExportSettings.instance.autoUpdaterEnabled = isAutoUpdaterOn;
343+
ExportSettings.instance.autoUpdaterEnabled = isAutoUpdaterOn;
343344
FbxPrefabAutoUpdater.runningUnitTest = false;
344345
}
345346
}
@@ -364,7 +365,7 @@ public void ExpensivePerformanceTest ()
364365
// Then modify one fbx model. Shouldn't take longer than 1s.
365366
var hierarchy = CreateGameObject("the_root");
366367
var baseName = GetRandomFbxFilePath();
367-
FbxExporters.Editor.ModelExporter.ExportObject(baseName, hierarchy);
368+
ModelExporter.ExportObject(baseName, hierarchy);
368369

369370
// Create N fbx models by copying files. Import them all at once.
370371
var names = new string[n];
@@ -410,7 +411,7 @@ public void ExpensivePerformanceTest ()
410411
// creating a file and then copying it, and not the FbxExporter.
411412
var newHierarchy = CreateHierarchy();
412413
var newHierarchyName = GetRandomFbxFilePath();
413-
FbxExporters.Editor.ModelExporter.ExportObject(newHierarchyName, newHierarchy);
414+
ModelExporter.ExportObject(newHierarchyName, newHierarchy);
414415
try {
415416
UnityEngine.Debug.unityLogger.logEnabled = false;
416417
stopwatch.Reset ();

Assets/com.unity.formats.fbx.tests/FbxPrefabTest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using UnityEngine;
2-
using UnityEditor;
3-
using UnityEngine.TestTools;
42
using NUnit.Framework;
53
using System.Collections.Generic;
6-
using System.Linq;
7-
using FbxExporters.Editor;
4+
using UnityEngine.Formats.Fbx.Exporter;
85

96
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
107
{

0 commit comments

Comments
 (0)