is it possible to reference Assembly-CSharp in play mode tests? I would like to test/use scripts in my tests but don't know how to reference Assembly-CSharp. thanks!
The question was answered in the Unity forum by the User 'MafiaMoe':
The 'solution' is to right-click on the Test Runner tab and click 'Enable playmode tests for all assemblies'. Then (after a restart of Unity) playmode tests can be written directly in the game scripts. I think this video has a good example: youtube
However, after working play mode tests into our game development routine, I think I have a better idea how this is all supposed to work. > What we have been doing is keeping the 'Enable playmode tests for all assemblies' OFF and setting up test scenes that are already pre- configured to 'run-on-load'. With that, all the playmode test scripts need to do is load the scene and assert that certain log messages show up.
This seems to keep the process of creating and maintaining tests less convoluted, as almost all of the configuration happens within the editor. This also means no playmode tests are awkwardly included in the > game scripts, when this type of test seems best suited to validate interactions between multiple scripts within a game scene.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With