How to Unit Test Player Input in Unity

Writing unit tests for Unity input code is hard because Unity’s Input class is static. In this video I’m going to show you two techniques that’ll make unit testing with Unity’s time and input APIs much easier: The Humble Object Pattern and Depencency Injection.

Unit Testing

The Importance of Unit Testing Business Logic

tl;dr – Unit testing business logic builds confidence in your code, fosters change, and supplies a way to passively create documentation.

When you first start unit testing you want to write tests for everything. New applications are easy because you can simply perform test driven development to guide the process. But writing a test suite for a legacy application can be pretty daunting.