Skip to content
Permalink
927d9de1f6
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
39 lines (24 sloc) 723 Bytes
package tests;
import view.StatGui;
import junit.framework.TestCase;
public class StatGuiTests extends TestCase {
private StatGui sg;
protected void setUp() throws Exception{
sg= new StatGui(0,0);
}
public void testMoney() throws Exception{
assertEquals(sg.getMoney(), 1000);
}
public void testCanAfford() throws Exception{
assertTrue(sg.canAfford(sg.getMoney()));
assertFalse(sg.canAfford(sg.getMoney()+10));
}
public void testSpendMoney() throws Exception{
assertTrue(sg.spendMoney(sg.getMoney()));
}
public void testPayDay() throws Exception{
sg.spendMoney(sg.getMoney());
sg.payDay(100);
assertEquals(sg.getMoney(), 100);
}
}