Saturday, October 8, 2016

How can I do unit testing in Unity?



How to implement Unit Test at Unity3D.


I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it.



  • Is there any guideline to implement it?

  • Any reference like book, blog?

  • Any working example or project?



Answer



I use with success NunitLite with the NunitLiteRunner plugin https://bitbucket.org/fddima/nunitlite/src/8a4e3c72f295?at=default



If you can be interested, I also blogged about IoC container that can help you with testing:


http://blog.sebaslab.com/ioc-container-for-unity3d-part-1/


http://blog.sebaslab.com/ioc-container-for-unity3d-part-2/


Edit: while the blog posts are still useful, you don't need nunitlite anymore nowadays. Unit Test Runner is now integrated in Unity. Unity Test Tools also adds more features on top of that: https://www.assetstore.unity3d.com/en/#!/content/13802


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...