If I include Unity PlayMode tests inside of the Editor folder, they don't show up in Unity. Why is that? This is a problem for me because if I keep these tests right under my Assets directory, I get this error with Unity Cloud Build:
error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?
In my PlayMode tests, I make reference to unity's editor namespace in my *.cs
test files: using UnityEditor;
I found a workaround by wrapping a pre-compiler directive around all of my *.cs
PlayMode test files:
#if UNITY_EDITOR
// Code in between.
#end if
But is this the best approach? What's really going on here and what's the best way to handle this situation with Unity Cloud Build when you have to make use of the UnityEditor namespace inside of a PlayMode test?