| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package com.zipcodewilmington.bankaccountlab;
-
- import org.junit.Before;
- import org.junit.Test;
-
- import static org.junit.Assert.*;
-
- public class MainApplicationTest {
- MainApplication ma;
-
- @Before
- public void setUp() {
- ma = new MainApplication();
- }
-
- @Test
- public void setCurrentAccount() {
- Account expected = AccountFactory.getAccount("Business", 10_000);
- ma.setCurrentAccount(expected);
- Account actual = ma.getCurrentAccount();
- assertEquals(expected, actual);
- }
-
- @Test
- public void askAndReceiveABusinessAccount() {
- String accountType = "Business";
- int amount = 10_000;
- Account expected = ma.createAndSetNewAccount(accountType, amount);
- Account actual = ma.getCurrentAccount();
- assertEquals(expected, actual);
- }
-
-
- @Test
- public void askAndReceiveASavingsAccount() {
- String accountType = "Savings";
- int amount = 1000;
- Account expected = ma.createAndSetNewAccount(accountType, amount);
- Account actual = ma.getCurrentAccount();
- assertEquals(expected, actual);
- }
-
- @Test
- public void askAndReceiveACheckingAccount() {
- String accountType = "Checking";
- int amount = 1000;
- Account expected = ma.createAndSetNewAccount(accountType, amount);
- Account actual = ma.getCurrentAccount();
- assertEquals(expected, actual);
- }
- }
|