Hey,
Is this any different from the runner in the Unity Test Tools package ? if not, what is different here?
Hey,
Is this any different from the runner in the Unity Test Tools package ? if not, what is different here?
I’d assume it’s just now built-in instead of a separate asset.
I assumed that too, but the link in the original thread (the one listing all the new things in 5.3) didn’t say anything about that.
Can you please make 1 small fix: i think that “run tests in a separate scene” should be made default.
all too often i run into the following scenario:
This is dangerous as it can get some “test only” objects into scenes.
I know that unit tests are not supposed to use game objects (since this is not a “pure” unit test), but still this is easier for me to create such tests that run in the editor to exercise some parts of our game.
If you’re creating game objects, should those not be integration tests?
It sort of is, but i’m already used to the syntax of creating unit tests and that’s so much easier for me.
Our test code instantiates some objects (that in turn may lazilly create GameObjects). I am not sure how the equivalent integration test would look like… at the bare minimum i know i should create a new test scene for it, but i haven’t investigated it further yet.
So now that NUnit is included, UnityTestTools will cause the project to fail to compile due to the two copies of NUnit. Like others, I assumed that this new test runner was just a bundled version of UnityTestTools but apparently it’s completely different; this one doesn’t use the UnityUnitTest and instead can run any standard NUnit test class? But it does not include NSubstitute or any of the integration tools? Is there going to be some sort of reconciliation of the two different test tools or is this new one going to replace the existing one?
How did you deduce that it’s “completely different” ? What is UnityUnitTest? i just use standard NUnit attributes for my unit tests with the currently available test runner…
Unity Test Tools contains a class called “UnityUnitTest” which inherits from a standard NUnit test class; I assumed it was necessary to inherit from it in order to get it to show up in the old test runner but maybe not; it could just be there for the helper methods. But this new version is missing things like NSubstitute and the integration test package.
I got both of them to work together by just deleting the NUnit.Framework.dll from the UnityTestTools package but leaving the other NUnit dll’s and the wrapper classes.
Sorry guys for late reply, I just came back from vacations.
The Editor Tests Runner is the Unit Tests Runner from Unity Test Tools package integrated in the editor. There’s been small changes to it but overall it’s the same runner and mostly the same code. It’s mostly the rendering code that’s been changed because the runner window is using the TreeView class from the editor.
The reason it got renamed to Editor Tests Runner is because although it’s NUnit driving the test run, you can write integration tests in it as well. I discussed this a little bit in this blog post: http://blogs.unity3d.com/2014/05/21/unit-testing-part-1-unit-tests-by-the-book/
To address your questions/issues: