Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.*;
- import static org.junit.Assert.*;
- public class BankAccountTest {
- @Test
- public void test0() throws Throwable {
- BankAccount bankAccount0 = new BankAccount("Insufficient balance");
- bankAccount0.deposit((-322));
- bankAccount0.withdraw((-344));
- int int0 = bankAccount0.withdraw(22);
- assertEquals(0, bankAccount0.getBalance());
- assertEquals(0, int0);
- }
- @Test
- public void test1() throws Throwable {
- BankAccount bankAccount0 = new BankAccount("Insufficient balance");
- bankAccount0.withdraw((-344));
- int int0 = bankAccount0.getBalance();
- assertEquals(344, int0);
- }
- @Test
- public void test2() throws Throwable {
- BankAccount bankAccount0 = new BankAccount(" Q1r/9<Jy;PoFP7T");
- try {
- bankAccount0.withdraw(486);
- fail("Expecting exception: Exception");
- } catch(Exception e) {
- //
- // Insufficient balance
- //
- }
- }
- @Test
- public void test3() throws Throwable {
- BankAccount bankAccount0 = new BankAccount(" Q1r/9<Jy;PoFP7T");
- bankAccount0.deposit((-1047));
- int int0 = bankAccount0.getBalance();
- assertEquals((-1047), int0);
- }
- @Test
- public void test4() throws Throwable {
- BankAccount bankAccount0 = new BankAccount("@9QWjl#QRUE");
- int int0 = bankAccount0.getBalance();
- assertEquals(0, int0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment