I'm trying to add unit tests to a Unity project. I'm using the Unity TestRunner window, adding an Edit Mode Test Assembly Folder, and adding a test C# script to it. The file is generated fine.
However, I can't actually test any of the main project's code because the test project can't see it. The Tests.csproj
that Unity is setting up doesn't include any of the .cs
files from the main directory tree; all it includes is, for some reason, a .txt
file. I can change this situation temporarily by copying over the XML from the main project's .csproj
file into Tests.csproj
, but Unity rewrites Tests.csproj
to put it back how it had it the next time it pays attention.
The Unity documentation doesn't hint at anything like this needing to be addressed. The MSVS documentation says I need to add a Reference to the project, but the Tests > References
context menu under Unity doesn't have the Add Reference
option it talks about.
What am I doing wrong?