- Home /
Testing MonoBehaviours in a Package
Hi! I'm working on a package.
It has MonoBehaviour scripts in it.
I'm trying to test these MB scripts.
I tried PlayMode with test Scenes. To LoadScene and 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 folderInstead 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?
Your answer
Follow this Question
Related Questions
Is there a way to add unit test in a sample of pacakge 0 Answers
Are tests required for custom packages? 1 Answer
Unity Test Framework not compiling since project version update 0 Answers
Prefabs not finding MonoBehaviours moved into a plugin DLL 1 Answer
Gun Class with Array List of Projectiles 2 Answers