Hi! I’m working on a package.
It has MonoBehaviour scripts in it.
I’m trying to test these MB scripts.
I decided to setup Test Scenes with certain states, load them during the Test, and to assert results.
-
I tried PlayMode Tests. To SceneManager.LoadScene and to assert results.
The issue:
Unity wants these Scenes to be added to BuildSettings.
I cannot do this, because this is a package. -
I tried EditorTests with EditorSceneManager.OpenScene
The issue: -
OpenScene* requires a path to a scene, and it cannot find my scene in Packages folder
-
Instead of scenes, I could Instantiate prefabs from my Tests folder. The issue: AssetDatabase cannot find assets in Packages folder.
The question!
How to setup Tests in a Package with several MonoBehaviours instantiated in a Scene-like or Prefab-like structure?