Unit tests should be added for all of the files within the core package, since they are critical to the code base. Here are a few ideas of things to test:
[x] API (#29)
Normal usage and initialization.
Using without initialization should throw APINotInitialized.
Initializing API more than once should throw InitAPIMoreThanOnce.
Accessing linearOpMode while isLinear is false should throw IllegalLinearOpModeAccess.
Initializing API with isLinear = true on a non-linear OpMode should throw InitLinearAPIWithoutLinearOpMode.
[ ] Dependencies
Normal usage with all dependencies fulfilled.
Initializing an API without its dependency should throw MissingDependency.
Calling API.init should in fact add the API to initializedAPIs.
[ ] Reset
Resettable property should allow normal usage. (Default value, modifying property.)
Reset.resetAll should reset Resettable properties to their default values.
Make sure that Resettables in the test folder do not get included to resetFunctions during a normal build.
Originally posted by @BD103 in https://github.com/BotsBurgh/BOTSBURGH-FTC-2024-25/issues/13#issuecomment-2167014333
Unit tests should be added for all of the files within the
core
package, since they are critical to the code base. Here are a few ideas of things to test:API
(#29)APINotInitialized
.InitAPIMoreThanOnce
.linearOpMode
whileisLinear
is false should throwIllegalLinearOpModeAccess
.isLinear = true
on a non-linearOpMode
should throwInitLinearAPIWithoutLinearOpMode
.Dependencies
MissingDependency
.API.init
should in fact add the API toinitializedAPIs
.Reset
Resettable
property should allow normal usage. (Default value, modifying property.)Reset.resetAll
should resetResettable
properties to their default values.Resettable
s in thetest
folder do not get included toresetFunctions
during a normal build.