Instantiating prefab causes assembly load error in unit test
I've set up a unit test in my Unity 2018 project, and upon trying to run it with the Test Runner, I got this error:
"Unhandled log message: '[Exception] SerializationException: Unable to find assembly 'NewAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.'. Use UnityEngine.TestTools.LogAssert.Expect"
I don't have an assembly called "NewAssembly" in my project. Such isn't referenced in my project's actual existing assemblies, either. And upon poking around some, it turns out that instantiating a successfully-loaded prefab caused the problem. Here's the code:
stagePrefab = Resources.Load<GameObject>(pathToStagePrefab);
stage = MonoBehaviour.Instantiate<GameObject>(stagePrefab);
How do I instantiate a prefab without getting this error?
Your answer
Follow this Question
Related Questions
Can I use LogAssert to check for errors in a unit test without cluttering the console? 0 Answers
In Unity3d test scripts, how to call a static function from another class? -2 Answers
Unable to see NUnit Assert message output 1 Answer
Unit test: PlayerPrefs, Attempted to access a missing method. 1 Answer
Testing on Genymotion: Grey Scene except Canvas items 1 Answer