| 12345678910111213141516171819202122232425262728293031323334353637 |
- package com.zipcodewilmington.bankaccountlab;
-
- import org.junit.Before;
- import org.junit.Test;
-
- import static org.junit.Assert.*;
-
- public class BusinessAccountTest {
- private BusinessAccount ba;
-
- @Before
- public void setUp() {
- ba = new BusinessAccount(10_000);
- }
-
- @Test
- public void constructorTest() {
- assertTrue(ba.getClass() == BusinessAccount.class);
- }
-
- @Test
- public void withdrawBalanceTruthyTest() {
- assertTrue(ba.withdrawBalance(100));
- }
-
- @Test
- public void withdrawBalanceFalseyTest() {
- assertFalse(ba.withdrawBalance(100_000));
- }
-
- @Test
- public void depositMoneyTest() {
- int expected = 25_000;
- int actual = ba.addBalance(15_000).getBalance();
- assertEquals(expected, actual);
- }
- }
|