-
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.
Removed EngineerMenuComponent. Modified forest game area for testing
- Loading branch information
1 parent
9d33fc9
commit ab7fc53
Showing
6 changed files
with
50 additions
and
164 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
150 changes: 0 additions & 150 deletions
150
source/core/src/main/com/csse3200/game/components/npc/EngineerMenuComponent.java
This file was deleted.
Oops, something went wrong.
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
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
42 changes: 42 additions & 0 deletions
42
source/core/src/test/com/csse3200/game/input/EngineerInputComponentTest.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,42 @@ | ||
package com.csse3200.game.input; | ||
|
||
import com.badlogic.gdx.Game; | ||
import com.badlogic.gdx.graphics.Camera; | ||
import com.csse3200.game.components.player.HumanAnimationController; | ||
import com.csse3200.game.entities.Entity; | ||
import com.csse3200.game.entities.EntityService; | ||
import com.csse3200.game.entities.factories.EngineerFactory; | ||
import com.csse3200.game.physics.PhysicsLayer; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.services.ServiceLocator; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.Mock; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import static org.mockito.Mockito.*; | ||
|
||
public class EngineerInputComponentTest { | ||
private EngineerInputComponent engineerInputComponent; | ||
|
||
|
||
@BeforeEach | ||
public void setup() { | ||
EntityService mockEntityService = mock(EntityService.class); | ||
ServiceLocator.registerEntityService(mockEntityService); | ||
|
||
Camera mockCamera = mock(Camera.class); | ||
Game game = mock(Game.class); | ||
this.engineerInputComponent = new EngineerInputComponent(game, mockCamera); | ||
} | ||
|
||
@Test | ||
public void testTouchDownWithNoSelectedEngineer() { | ||
when(ServiceLocator.getEntityService().getEntityAtPositionLayer(anyFloat(), anyFloat(), anyShort())).thenReturn(null); | ||
// nothing happened -> false | ||
boolean result = engineerInputComponent.touchDown(0, 0, 0, 0); | ||
assertFalse(result); | ||
// no engineer should be selected | ||
assertNull(engineerInputComponent.selectedEngineer); | ||
} | ||
} |