Skip to content

Commit

Permalink
Fixed a bug that caused the Projectile Junit tests to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniSoda17 committed Sep 7, 2023
1 parent 1bfc817 commit e540536
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 53 deletions.
41 changes: 0 additions & 41 deletions source/core/assets/images/projectiles/basic_projectile_old.atlas

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
package com.csse3200.game.entities.factories;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.math.Vector;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.csse3200.game.components.CombatStatsComponent;
import com.csse3200.game.components.Component;
import com.csse3200.game.components.CostComponent;
import com.csse3200.game.components.TouchAttackComponent;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.EntityService;
import com.csse3200.game.areas.ForestGameArea;
import com.csse3200.game.extensions.GameExtension;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.PhysicsService;
import com.csse3200.game.physics.components.ColliderComponent;
import com.csse3200.game.physics.components.HitboxComponent;
import com.csse3200.game.physics.components.PhysicsComponent;
import com.csse3200.game.physics.components.PhysicsMovementComponent;
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.Ignore;
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.*;
import java.security.Provider;
import java.util.Arrays;

@ExtendWith(GameExtension.class)
class ProjectileFactoryTest {
private String[] texture = {"images/projectiles/projectile.png"};
private Entity projectile;

@BeforeEach
Expand All @@ -45,13 +50,13 @@ public void setUp() {
ServiceLocator.registerRenderService(render);
ResourceService resourceService = new ResourceService();
ServiceLocator.registerResourceService(resourceService);
resourceService.loadTextures(texture);
// resourceService.loadTextures(texture);
// resourceService.loadTextureAtlases(atlas);
resourceService.loadAll();
ServiceLocator.getResourceService()
.getAsset("images/projectiles/projectile.png", Texture.class);
// ServiceLocator.getResourceService()
// .getAsset("images/projectiles/basic_projectile.atlas", TextureAtlas.class);
Vector2 destination = new Vector2(0.1f, 0.1f);
Vector2 speed = new Vector2(0.2f, 0.2f);

projectile = ProjectileFactory.createBaseProjectile(destination);
}

Expand Down

0 comments on commit e540536

Please sign in to comment.