-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix tests and various bug fixes
- Loading branch information
Showing
42 changed files
with
4,181 additions
and
2,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Chocopoi.DressingTools.Tests | ||
{ | ||
// a test script base containing utility functions | ||
public class DTEditorTestBase : DTRuntimeTestBase | ||
{ | ||
protected T LoadEditorTestAsset<T>(string relativePath) where T : Object | ||
{ | ||
// load test asset from resources folder | ||
var path = "Assets/_DTDevOnly/Tests/Editor/Resources/" + GetType().Name + "/" + relativePath; | ||
var obj = AssetDatabase.LoadAssetAtPath<T>(path); | ||
Assert.NotNull(obj, "Could not find test asset at path:" + path); | ||
return obj; | ||
} | ||
|
||
protected GameObject InstantiateEditorTestPrefab(string relativePath, Transform parent = null) | ||
{ | ||
// load test prefab and instantiate it | ||
var prefab = LoadEditorTestAsset<GameObject>(relativePath); | ||
var obj = Object.Instantiate(prefab); | ||
instantiatedGameObjects.Add(obj); | ||
|
||
if (parent) | ||
{ | ||
obj.transform.parent = parent; | ||
} | ||
return obj; | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.