Skip to content

Unit test for the Input system #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kgc00
Copy link
Contributor

@kgc00 kgc00 commented Nov 3, 2020

Do you have a forum thread linked to this PR?
https://forum.unity.com/threads/what-about-unit-testing.981069/#post-6488173

What will this PR bring to the project for everyone?
Some example of a unit test for the input system and project structure for future tests. inlcudes tests for the input reader and unity's new input system.

Why are these changes necessary?
RE forum: the earlier we get this stuff in the easier it will be to maintain. Less headaches in the future =)

How did you implement them?

  • for inputreader i had to make the GameInput property public get, private set
  • I had to put the input reader in it's own assembly so I could access it from the tests folder. it's in UOP1.Input now
  • altered the manifest.json to mark com.unity.inptutsystem] as testable
  • made some boiler plate folder structure in a tests folder to hold future edit / play mode tests
  • wrote some tests for input reader

Mostly similar to #88 but with functional inputreader tests and no introduced packages/dependencies.

@ciro-unity ciro-unity changed the title Enhancement/tests Unit test for the Input system Nov 4, 2020
@ciro-unity ciro-unity added the tool A PR that contains an Editor tool or custom Inspectors label Nov 4, 2020
@ciro-unity ciro-unity added the on hold Depends on functionality we haven't decided on yet, or is beyond scope. Will be revisited later. label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Depends on functionality we haven't decided on yet, or is beyond scope. Will be revisited later. tool A PR that contains an Editor tool or custom Inspectors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants