I have a problem with testing my java's bank implementation. I tried a lot of testing classes including these copied from my friends, in which who it was testing properly. In my project it always prints this exact error, which I posted below.
And here is a piece of code of my test bank implementation:
package bank;
import org.junit.Before;
import org.junit.Test;
public class testmacka {
private BankImpl testowa;
@Before
public void create(){
testowa=new BankImpl();
}
@Test(expected = BankImpl.InsufficientFundsException.class)
public void test6(){
int idd=testowa.createAccount("Szmariusz", "Grajewo 45");
testowa.deposit(idd, 1000);
testowa.withdraw(idd, 1100);
}
@Test
public void test2a(){
int idx=testowa.createAccount("cris", "Las");
testowa.deposit(1, 600);
boolean i=(testowa.getBalance(idx)==600);
assert i;
}
@Test(expected = BankImpl.AccountIdException.class)
public void test2c(){
testowa.deposit(-400, 900);
}
@Test(expected = BankImpl.AccountIdException.class)
public void test2d(){
testowa.getBalance(-9);
}
@Test(expected = BankImpl.AccountIdException.class)
public void test3(){
testowa.deposit(12, 200);
}
@Test
public void test4(){
int id1=testowa.createAccount("x", "y");
int id2=testowa.createAccount("x", "y");
assert id1==id2;
}
@Test
public void test5(){
int id3=testowa.createAccount("kk", "kk");
assert null!=testowa.findAccount("kk", "kk");
}
@Test(expected = BankImpl.InsufficientFundsException.class)
public void test7(){
int idd2=testowa.createAccount("Szmariusz2", "Grajewo 45");
int idd1=testowa.createAccount("Krzysztof", "Zambrow");
testowa.deposit(idd2, 1000);
testowa.deposit(idd1, 900);
testowa.transfer(idd1, idd2, 1100);
}
}
I will appreciate any suggestions.
Aucun commentaire:
Enregistrer un commentaire