Skip to content
Permalink
c64d9dd87c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
59 lines (53 sloc) 1.2 KB
import static org.junit.Assert.*;
import junit.framework.TestCase;
import org.junit.Test;
public class MinionFactoryTests extends TestCase {
MapTowerDefense map;
MinionFactory MF;
int[][] nodes;
int NUM;
public void setUp() {
NUM = 6;
nodes = new int[NUM][2];
nodes[0][0] = 1;
nodes[0][1] = 3;
nodes[1][0] = 16;
nodes[1][1] = 3;
nodes[2][0] = 16;
nodes[2][1] = 9;
nodes[3][0] = 4;
nodes[3][1] = 9;
nodes[4][0] = 4;
nodes[4][1] = 15;
nodes[5][0] = 18;
nodes[5][1] = 15;
MockGui mg = new MockGui(640,640,32, NUM, nodes);
StatGui sg= new StatGui(0,0);
map = new MapTowerDefense(100, NUM, nodes, mg, sg);
MF = map.getMF();
mg.setMap(map);
sg.setMap(map);
sg.setup();
}
public void testX() {
assertEquals(1, MF.getX());
}
public void testY() {
assertEquals(3, MF.getY());
}
public void testMax() {
assertEquals(100, MF.getMax());
}
public void testID() {
assertEquals(0, MF.getNum());
}
public void testCreateMinion() {
MF.createRandominion();
assertEquals(1,MF.getNum());
}
public void testCreate2Minions() {
MF.createRandominion();
MF.createRandominion();
assertEquals(2,MF.getNum());
}
}