2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
* You should have received a copy of the GNU General Public License
11
* along with this program; if not, write to the Free Software
12
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
package games.strategy.triplea.Dynamix_AI;
17
import games.strategy.engine.data.GameData;
18
import games.strategy.engine.data.PlayerID;
19
import games.strategy.engine.data.UnitType;
20
import games.strategy.triplea.baseAI.AIUtils;
21
import games.strategy.triplea.xml.LoadGameUtil;
22
import junit.framework.TestCase;
28
public class DynamixAITests extends TestCase
30
private GameData m_data;
31
private Dynamix_AI m_ai;
34
protected void setUp() throws Exception
36
m_data = LoadGameUtil.loadGame("Great Lakes War", "Great Lakes War v1.4.xml");
37
m_ai = new Dynamix_AI("Superior");
41
protected void tearDown() throws Exception
46
public void testCost()
48
UnitType infantry = m_data.getUnitTypeList().getUnitType("infantry");
49
PlayerID superior = m_data.getPlayerList().getPlayerID("Superior");
51
assertEquals(3, AIUtils.getCost(infantry, superior, m_data));