New functional test additions
Adding new test cases aimed at capturing the main campaign game states, increasing testability, test coverage, and for adding tests verifying method execution through the use of mocking. This PR is test suite focused.
Inside DirectConsumerTests.java:
- Added 2 partition tests for varying inputs for Power requests. Goal is to test more types of inputs to ensure proper efficiency
noPowerRequestedWithNoItemsParameterized()noPowerRequestedSufficiencyParameterized()
Inside ApplicationTests.java
-
Added 5 functional tests to ensure proper game states during campaign game mode
runSectorCaptured()runBossWave()wavesActiveStateTest()waveCountdownStateTest()gameOverStateTest() -
Increased test coverage inside
Logic.javawith a new test case (more line, method and branch coverage)fogOfWarUpdateTest() -
Increased test coverage inside
ItemModule.javawith 4 new test cases (increase in method, line and branch coverage)addingEntireTileContentsTile()itemModuleIDCoal()itemModuleByItemCoal()itemStackRemoveAndVerifyCheck() -
Increased test coverage inside
Turret.javawith new test casetestAmmoLoadingCap() -
Increased test coverage inside
Drill.javawith 3 new test casestestDrillTypes()testDrillWithWater()testDrillOres() -
Increased test coverage inside
Distribution Packagewith 3 new test casestestDistributor()testUnloader()testOverflowGate() -
Added test case to improve testability with testing of liquid flow. This test also uses 2 new methods inside
Conduit.javaandBuildingComp.javaaimed at our dummy methods. Goal here is to have these methods simplify logic for the purpose of testability in relation to liquid flow systems.liquidJunctionOutputTestability() -
Use of mocking to further test
Logicexecution, andTurretbuilding. NOTE: Kinda worried about the Mockito package inclusion because it may be incompatible. May need clarification here.mockVerifyLogicGameStateReset()logicMockTest()mockTurretBuildVerification()
Also addition of more comments to touched methods inside DirectConsumerTests.java, and ApplicationTests,java
If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:
- [X] I have read the contribution guidelines.
- [X] I have ensured that my code compiles, if applicable.
- [X] I have ensured that any new features in this PR function correctly in-game, if applicable.