Ok I have been using Unity long enough now that I am breaking my own code 
So i would like to setup regression testing scenes. A scene just used to test and make sure my scripts still do what they did an hour ago. Using captureFramerate I can make sure that that Time.deltaTime won’t vary from one test to another. And using a test manager script and LateUpdate I can monitor any object to make sure it changes as it should. The only thing I can’t figure is how to do is send events to Unity like mouseDown, mouse movement and keyPress. I could just send them directly to the object which would be good for Unit testing, but I also want to do integration testing.
Any suggestion on how to inject events under script control, or replay recorded mouse movements at a captureFramerate related speed?
Cheers,
Grant
Instead of directly reading input events in your code, make a separate wrapper class that reads those events and outputs them to your code. That class can then emit fake (recorded) events as well as real ones and the rest of your code doesn’t need to know the difference.
That will for unit testing wher I have the test manager call OnMouseDown for an Object directly. I also want know that if the users moved her mouse over screen co-ordinate x,y and pressed middle mouse button the same thing happens this time as last time. Where if the modeler changed the prefab and the collision box by accident this will no longer happen. But sending events from an event manager would not catch this.
Even without event injection UnityUnit is still writeable and I will start on it when I complete my current milestone. I think 90% of usefulness of UnityUnit for my type games does not need event injection.
Cheers,
Grant