test
This commit is contained in:
JonatanRek
2020-01-31 16:10:04 +01:00
commit bea2dce063
3837 changed files with 179123 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
namespace UnityEngine.TestTools
{
public interface IMonoBehaviourTest
{
bool IsTestFinished {get; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a002d3737b873954395b7cf862873ab8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
namespace UnityEngine.TestTools
{
public class MonoBehaviourTest<T> : CustomYieldInstruction where T : MonoBehaviour, IMonoBehaviourTest
{
public T component { get; }
public GameObject gameObject { get { return component.gameObject; } }
public MonoBehaviourTest(bool dontDestroyOnLoad = true)
{
var go = new GameObject("MonoBehaviourTest: " + typeof(T).FullName);
component = go.AddComponent<T>();
if (dontDestroyOnLoad)
{
Object.DontDestroyOnLoad(go);
}
}
public override bool keepWaiting
{
get { return !component.IsTestFinished; }
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 164c9b1458eaab743a4b45c37a4d720d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: