Unit Testing : Sheet1
1
Test MethodTest ConditionExpected ResultPass?NotesKey
2
12345678910
3
LwjglTestRunnerTest#RunsWithoutExceptionsLwjglTestRunner runs a test without exceptions.The test passes.YYYYYYYYYYNo.Merge
4
LwjglTestRunnerTest#CausesAnExceptionWhenExpectedLwjglTestRunner runs a test with exceptions.The test fails.YYYYYYYYYY1#21 Box2d
5
CharacterTest#CanAccessMaxHealthA Character was created with a certain max health.
Character#getMaximumHealth() is equal to the original maximum health.
YYYYYYYYYY2#24 Add an LWJGL Test Runner.
6
CharacterTest#CanAccessCurrentHealthA Character was created with a certain max health.
Without updating, Character#getCurrentHealth() is equal to the maximum health.
YYYYYYYYYY3#25 Added SurvivalObjective
7
CharacterTest#CanBeDamagedA Character was damaged by a certain amount.
Character#getCurrentHealth() is equal to the maximum health - damage.
YYYYYYYYYY4#23 Create LICENSE
8
CharacterTest#CanBeKilledA Character is damaged more than their max health.Character#isDead() is true.YYYYYYYYYY5
9
CharacterTest#IsHealableA Character is damaged, and then healed.
Character#getCurrentHealth() is equal to the maximum - damage + heal.
YYYYYYYYYY6#28 Water
10
CharacterTest#CannotBeHealedPastMaxA Character is damaged, and healed past max health.
Character#getCurrentHealth() is equal to Character#getMaximumHealth().
YYYYYYYYYY7#29 Minimap
11
ObjectiveTest#HasCorrectObjectiveStringAn Objective is created with a given name.Objective#getObjectiveString() is the same as the name.YYYYYYYYYY8#31 Map screen
12
ObjectiveTest#IsUpdatedAn Objective is created.Objective#update() lets the objective's logic update.YYYYYYYYYY9#32 Weapons
13
ObjectiveTest#IsOngoingByDefaultAn Objective is created.Objective#getStatus() is ONGOING by default.YYYYYYYYYY10Music
14
ParticleTest#NotRemovedBeforeDurationA Particle is created with a given duration.
Particle#isRemoved() is false after an update smaller than its duration.
YYYYYYYYYY
15
ParticleTest#RemovedAfterDurationA Particle is created with a given duration.Particle#isRemoved() is true after an update larger than its duration.YYYYYYYYYYYPassed
16
PathfindingAITest#ChasesPlayerHorizontallyA Player and a Mob with PathfindingAI is created.The mob is horizontally closer to the player.IIIIIIIIIIThe tests are ignored because the class has Round as a dependency. Round is a very heavy class that does a variety of complex tasks and has a large number of dependencies that cannot be easily mocked or separated.IIngnored
17
PathfindingAITest#ChasesPlayerVerticallyA Player and a Mob with PathfindingAI is created.The mob is vertically closer to the player.IIIIIIIIII
18
PathfindingAITest#StopsIfRangeProvided
A Player and a Mob with PathfindingAI is created with a range.
The mob stops within a certain range of the player.IIIIIIIIII
19
PathfindingAITest#TakesExpectedRouteAroundObstacle
A Player and a Mob with PathfindingAI is created in a test level.
The mob goes around obstacles and reaches the player.IIIIIIIIII
20
ProjectileTest#StartsAtCorrectPositionA Projectile is created with a given position.Projectile#getPosition() is the original position.IIIIIIIIII
21
PlayerTest#StartsAtCorrectPositionA Player is created with a given position.Player#getPosition() is the original position.IIIIIIIIIILibGDX generates an obscure error (java.lang.UnsatisfiedLinkError) when running under the testing conditions. This is probably because Box2D (the physics library) requires a display to be able to work.
22
PlayerTest#ScoreStartsAtZeroA Player is created.Player#getScore() is zero by default.IIIIIIIIII
23
PlayerTest#CanAddScoreA Player is created and some points are added.Player#getScore() is equal to the points added.IIIIIIIIII
24
PlayerTest#CanAddPickupA Player is created and a Pickup is added to it.The Pickup is accessible from the Player.IIIIIIIIII
25
PlayerTest#ScoreMultiplierWorks
A Player is created, a Score Multiplier and the score is added.
Player#getScore() is PLAYER_SCORE_MULTIPLIER x score added.IIIIIIIIII
26
PlayerTest#CannotBeDamagedWhenInvulnerable
A Player is created, Invulnerability is added and is damaged.
Player#getHealth() does not change.IIIIIIIIII
27