Running unit tests in visual studio

Hello,
Is it possible to run unit tests outside of Unity’s TestRunner? Like from Visual Studio with/without Resharper (or maybe Rider)?
When I’m trying to run a test it’s detected but I get info about it being inconclusive :confused:

1 Like

I have the same question!

It is “kinda” possible, but the unit test code must be in a different project, and the code being tested must not use any UnityEngine functionality or Unity will throw a security exception. I used it that way for a long time since the code being tested was decoupled from calls to Unity functionality, but I suspect for most people’s needs, that might not be feasible.

I would really love for the ability to use the VS test runner for “proper” Unity unit tests because it is just a lot nicer to right click on the test right there in the code from within VS and run it, or step right into it with the debugger attached.

5 Likes