From 4cb8617b5ea6070338d8ded67475f09c749395cc Mon Sep 17 00:00:00 2001 From: Kevin <104761532+Hasakev@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:40:53 +1000 Subject: [PATCH] Removed Redundant test --- .../csse3200/game/areas/ForestGameArea.java | 2 +- .../components/tasks/waves/WaveTaskTest.java | 89 ------------------- 2 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 source/core/src/test/com/csse3200/game/components/tasks/waves/WaveTaskTest.java diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 96a2be3b8..bced9162e 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -293,7 +293,7 @@ public void create() { waves.getEvents().addListener("spawnWave", this::spawnMob); spawnScrap(); -// spawnGapScanners(); + spawnGapScanners(); } private void displayUI() { diff --git a/source/core/src/test/com/csse3200/game/components/tasks/waves/WaveTaskTest.java b/source/core/src/test/com/csse3200/game/components/tasks/waves/WaveTaskTest.java deleted file mode 100644 index a47359ffc..000000000 --- a/source/core/src/test/com/csse3200/game/components/tasks/waves/WaveTaskTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.csse3200.game.components.tasks.waves; - -import com.badlogic.gdx.audio.Sound; -import com.csse3200.game.ai.tasks.PriorityTask; -import com.csse3200.game.ai.tasks.Task; -import com.csse3200.game.areas.ForestGameArea; -import com.csse3200.game.areas.terrain.TerrainFactory; -import com.csse3200.game.components.tasks.DroidCombatTask; -import com.csse3200.game.components.tasks.waves.LevelWaves; -import com.csse3200.game.components.tasks.waves.WaveTask; -import com.csse3200.game.extensions.GameExtension; -import com.csse3200.game.services.GameTime; -import com.csse3200.game.services.ResourceService; -import com.csse3200.game.services.ServiceLocator; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.logging.Level; - -import static org.junit.Assert.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -@Disabled -@ExtendWith(GameExtension.class) -@ExtendWith(MockitoExtension.class) -class WaveTaskTest { - - WaveTask waveTask; - ResourceService resourceService; - LevelWaves level; - ForestGameArea gameArea; - @BeforeEach - void setUp() { - resourceService = ServiceLocator.getResourceService(); - GameTime globalTime = mock(GameTime.class); - level = mock(LevelWaves.class); - ServiceLocator.registerTimeSource(globalTime); - waveTask = new WaveTask(); - } - - @Test - public void testLoadSounds() { - String[] sounds = waveTask.getSounds(); - resourceService.getAsset(sounds[0], Sound.class); - resourceService.getAsset(sounds[1], Sound.class); - } - - @Test - public void testGetPriority() { - int priority = waveTask.getPriority(); - assertEquals(10, priority); - } - - @Test - public void testStartFirstWave() { - waveTask.start(); - assertEquals(10, waveTask.getPriority()); - assertTrue(waveTask.isWaveInProgress()); - assertEquals(1, waveTask.getCurrentWaveIndex()); - } - - @Test - public void testIsWaveInProgress() { - waveTask.start(); - assertTrue(waveTask.isWaveInProgress()); - } - - @Test - public void testUpdateOnEmptyWaveAndNoNextWave() { - waveTask.start(); - ServiceLocator.getWaveService().setEnemyCount(0); - waveTask.update(); - assertTrue(ServiceLocator.getWaveService().isLevelCompleted()); - } - - @Test - public void testUpdateOnEmptyWaveAndNextWave() { - waveTask.start(); - int waveNumber = waveTask.getCurrentWaveIndex(); - ServiceLocator.getWaveService().setEnemyCount(0); - waveTask.update(); - assertTrue(waveNumber + 1 == waveTask.getCurrentWaveIndex()); - } - -}