Skip to content

Test Plan

gilgilgilgilgil edited this page Aug 29, 2023 · 1 revision

TimeController

Plan is to apply at least 3 test cases for relevant methods of TimeController:

  1. A time in the first 12 minute cycle (e.g. 300,000 ms).
  2. A time in the transition between 12-min cycles (720,000 ms or a multiple of this).
  3. A time after the transition to the new cycle (e.g. 800,000 ms).

As per Unit Testing :

  • All tests should should extend from GameExtension, using the @ExtendWith(GameExtension.class) annotation. This ensures that the correct mocking of underlying graphics is done, and that the service locator is cleared between tests.
  • When testing anything that relies on time, use ServiceLocator.getTimeSource() as your time source. Then in your tests you can provide a custom timesource with hardcoded values. You should never have tests that rely on real time passing.

All other dependencies will be made with mock objects using the Mockito library.

Clone this wiki locally