-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated humanWanderTask and started writing tests
- Loading branch information
1 parent
8ab5f3a
commit 5a17e39
Showing
6 changed files
with
179 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
source/core/src/test/com/csse3200/game/components/player/HumanAnimationControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.csse3200.game.components.player; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class HumanAnimationControllerTest { | ||
|
||
@BeforeEach | ||
void setUp() { | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
} | ||
|
||
@Test | ||
void create() { | ||
} | ||
|
||
@Test | ||
void animateIdleLeft() { | ||
} | ||
|
||
@Test | ||
void animateIdleRight() { | ||
} | ||
|
||
@Test | ||
void animateLeftWalk() { | ||
} | ||
|
||
@Test | ||
void animateRightWalk() { | ||
} | ||
|
||
@Test | ||
void animateFiring() { | ||
} | ||
|
||
@Test | ||
void animateHit() { | ||
} | ||
|
||
@Test | ||
void animateDeath() { | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
source/core/src/test/com/csse3200/game/components/tasks/human/HumanMovementTaskTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.csse3200.game.components.tasks.human; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class HumanMovementTaskTest { | ||
|
||
@BeforeEach | ||
void setUp() { | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
} | ||
|
||
@Test | ||
void start() { | ||
} | ||
|
||
@Test | ||
void update() { | ||
} | ||
|
||
@Test | ||
void setTarget() { | ||
} | ||
|
||
@Test | ||
void stop() { | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
source/core/src/test/com/csse3200/game/components/tasks/human/HumanWanderTaskTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.csse3200.game.components.tasks.human; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class HumanWanderTaskTest { | ||
|
||
@BeforeEach | ||
void setUp() { | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
} | ||
|
||
@Test | ||
void getPriority() { | ||
} | ||
|
||
@Test | ||
void start() { | ||
} | ||
|
||
@Test | ||
void update() { | ||
} | ||
} |
66 changes: 65 additions & 1 deletion
66
source/core/src/test/com/csse3200/game/entities/factories/EngineerFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,68 @@ | ||
package com.csse3200.game.entities.factories; | ||
|
||
import com.badlogic.gdx.audio.Sound; | ||
import com.badlogic.gdx.graphics.g2d.TextureAtlas; | ||
import com.csse3200.game.entities.Entity; | ||
import com.csse3200.game.extensions.GameExtension; | ||
import com.csse3200.game.physics.PhysicsService; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.rendering.DebugRenderer; | ||
import com.csse3200.game.rendering.RenderService; | ||
import com.csse3200.game.services.GameTime; | ||
import com.csse3200.game.services.ResourceService; | ||
import com.csse3200.game.services.ServiceLocator; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
|
||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
@ExtendWith(GameExtension.class) | ||
class EngineerFactoryTest { | ||
|
||
Entity target = new Entity(); | ||
private String[] texture = { | ||
"images/engineers/engineer.png" | ||
}; | ||
private String[] atlas = {"images/engineers/engineer.atlas"}; | ||
private static final String[] sounds = { | ||
"sounds/engineers/firing_auto.mp3" | ||
}; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
GameTime gameTime = mock(GameTime.class); | ||
when(gameTime.getDeltaTime()).thenReturn(0.02f); | ||
ServiceLocator.registerTimeSource(gameTime); | ||
ServiceLocator.registerPhysicsService(new PhysicsService()); | ||
RenderService render = new RenderService(); | ||
render.setDebug(mock(DebugRenderer.class)); | ||
ServiceLocator.registerRenderService(render); | ||
ResourceService resourceService = new ResourceService(); | ||
ServiceLocator.registerResourceService(resourceService); | ||
resourceService.loadTextureAtlases(atlas); | ||
resourceService.loadSounds(sounds); | ||
resourceService.loadAll(); | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
|
||
} | ||
|
||
@Test | ||
void createEngineer() { | ||
Entity engineer = EngineerFactory.createEngineer(target); | ||
assertNotNull(engineer); | ||
} | ||
|
||
@Test | ||
void createBaseHumanNPC() { | ||
Entity human = EngineerFactory.createBaseHumanNPC(target); | ||
assertNotNull(human); | ||
} | ||
} |