
package engineTests;

import objects.GameObject;

import org.junit.Test;

import stage.Game;
import engine.GameEngine;
import junit.framework.TestCase;

/**
 * @Author: Justin (Zihao) Zhang
 */

public class GameObjectTests extends TestCase {
	
		protected GameEngine myEngine;
		protected Game myGame;

	    protected void setUp(){
	    	myGame = new Game();
	    	myEngine = new GameEngine(true);
	    	myEngine.setGame(myGame);
			myGame.addLevel(1);
			myGame.addScene(1, 0);
			myEngine.setCurrentScene(1, 0);
	    }
		
		@Test
		public void testCreateObjects(){
			GameObject object = myEngine.createActor(0, "actor_default.png", 0, 0, "Hero", 0, 1);
			assertEquals(object, myGame.getNonPlayer(1, 0, 0));
		}
		
		@Test
		public void testGetAttributes(){
			GameObject object = myEngine.createActor(1, "actor_default.png", 0, 0, "Hero", 0, 1);
			System.out.println(object.getAttributes());
		}
		
		@Test
		public void testModifyCollision(){
			GameObject object = myEngine.createActor(1, "actor_default.png", 0, 0, "Hero", 0, 1);
			object.setCollisionBehavior("HitterEliminateVictim", 2);
//			assertEquals("HitterEliminateVictim", object.myCollisionMap.get(2));
		}
		
		@Test
		public void testModifyMove(){
			GameObject object = myEngine.createActor(1, "actor_default.png", 0, 0, "Hero", 0, 1);
			object.setMoveBehavior("RegularMove", 1, 1);
			myEngine.doFrameEdit();
//			assertEquals("RegularMove", object.myMoveBehavior);
		}
		
		@Test
		public void testModifyDie(){
			GameObject object = myEngine.createActor(1, "actor_default.png", 0, 0, "Hero", 0, 1);
			object.setDieBehavior("RegularRemove");
//			assertEquals("RegularRemove", object.myDieBehavior);
		}
		
		@Test
		public void testResources(){
//			assertEquals(, other.get);
//			assertEquals("Chinese", myLangManager.getCurrentLanguage());
//			Throwable caught = null;
//			try {
//				assertEquals(false, myLangManager.setLanguage("Japanese"));
//			} catch (Throwable t) { caught = t; }
//			assertNotNull(caught);
//			assertSame(LanguageNotFoundException.class, caught.getClass());
		}
		
}



@@ -610,47 +610,57 @@
 tor(
-0, %22actor_default
+123, %22Mario
 .png%22, 
+20
 0, 
+20
 0, 
-%22Hero%22, 0
+600.0, 450.0, null, 2
 , 1)
@@ -815,49 +815,214 @@
 or(1
+23
 , %22
-actor_default
+Mario
 .png%22, 
+20
 0, 
+20
 0, 
-%22Hero
+600.0, 450.0, null, 2, 1);%0A%09%09%09object.setCollisionBehavior(%22HitterEliminateVictim%22, 2);%0A%09%09%09object.setMoveBehavior(%22RegularMove
 %22, 
+1.
 0, 1
+.0);%0A%09%09%09object.setDieBehavior(%22RegularRemove%22
 );%0A%09
@@ -1168,46 +1168,56 @@
 or(1
+23
 , %22
-actor_default
+Mario
 .png%22, 
+20
 0, 
+20
 0, 
-%22Hero%22, 0
+600.0, 450.0, null, 2
 , 1)
@@ -1448,46 +1448,56 @@
 or(1
+23
 , %22
-actor_default
+Mario
 .png%22, 
+20
 0, 
+20
 0, 
-%22Hero%22, 0
+600.0, 450.0, null, 2
 , 1)
@@ -1544,38 +1544,15 @@
 %22, 1
+.0
 , 1
-);%0A%09%09%09myEngine.doFrameEdit(
+.0
 );%0A/
@@ -1702,46 +1702,56 @@
 or(1
+23
 , %22
-actor_default
+Mario
 .png%22, 
+20
 0, 
+20
 0, 
-%22Hero%22, 0
+600.0, 450.0, null, 2
 , 1)

update test