Skip to content

Commit

Permalink
Created MobAttackTaskTest, needs to be edited further
Browse files Browse the repository at this point in the history
  • Loading branch information
meganroxburgh committed Sep 11, 2023
1 parent 63cc937 commit 69ca995
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import com.csse3200.game.events.listeners.EventListener0;
import com.csse3200.game.extensions.GameExtension;
import com.csse3200.game.utils.math.Vector2Utils;
import com.csse3200.game.physics.components.PhysicsMovementComponent;
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;
import com.csse3200.game.physics.components.PhysicsMovementComponent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -20,25 +20,30 @@
@ExtendWith(GameExtension.class)
@ExtendWith(MockitoExtension.class)
class MobAttackTaskTest {
@Mock
/**
* Class for testing MobAttackTask
*/
GameTime gameTime;

// @BeforeEach
// void beforeEach() {
// ServiceLocator.registerTimeSource(gameTime);
// // To Do
// }
//
// @Test
// void shouldShootProjectile() {
// Entity target = new Entity();
// target.setPosition(2f, 2f);
@BeforeEach
void setUp() {
ServiceLocator.registerTimeSource(gameTime);
}

@Test
void shouldShootProjectile() {
// MobAttackTask mobAttackTask = new MobAttackTask(2, 40);
//
// AITaskComponent ai = new AITaskComponent().addTask(new MobAttackTask(target, 10, 5, 10));
// Entity entity = makePhysicsEntity().addComponent(ai);
// AITaskComponent aiTaskComponent = new AITaskComponent().addTask(mobAttackTask);
// Entity entity = new Entity().addComponent(aiTaskComponent);
// entity.create();
// entity.setPosition(0f, 0f);
//
// // To Do
// }
// // Register callbacks
// EventListener0 callback = mock(EventListener0.class);
// entity.getEvents().addListener("shootStart", callback);
//
// mobAttackTask.start();
//
// verify(callback).handle();
}
}

0 comments on commit 69ca995

Please sign in to comment.