3
3
import org .junit .Assert ;
4
4
import org .junit .Before ;
5
5
import org .junit .Test ;
6
+ import squier .john .reusingClasses .ATM .*;
6
7
7
8
import java .util .ArrayList ;
8
9
12
13
public class ATMTest {
13
14
14
15
ATM atm ;
15
- ArrayList <Account > accounts ;
16
+ ArrayList <ATM . Account > accounts ;
16
17
17
18
@ Before
18
19
public void setup () {
19
- accounts = new ArrayList <Account >();
20
+ accounts = new ArrayList <ATM . Account >();
20
21
21
- Account account1 = new SavingsAccount (
22
+ ATM . Account account1 = new SavingsAccount (
22
23
BankAccountType .SAVINGS , 100.0 , "John" , 10.0 ,
23
24
BankAccountStatus .OPEN , OverdraftProtection .ENABLED );
24
25
25
- Account account2 = new CheckingAccount (BankAccountType .CHECKING , 50.0 , "Alice" , 0.0 ,
26
+ ATM . Account account2 = new CheckingAccount (BankAccountType .CHECKING , 50.0 , "Alice" , 0.0 ,
26
27
BankAccountStatus .OPEN , OverdraftProtection .DISABLED );
27
28
28
29
29
- Account account3 = new InvestmentAccount (BankAccountType .INVESTMENT , 10000.0 , "Bob" , 15.0 ,
30
+ ATM . Account account3 = new InvestmentAccount (BankAccountType .INVESTMENT , 10000.0 , "Bob" , 15.0 ,
30
31
BankAccountStatus .OPEN , OverdraftProtection .ENABLED );
31
32
32
33
accounts .add (account1 );
@@ -38,8 +39,8 @@ public void setup() {
38
39
39
40
@ Test
40
41
public void getAccountsTest () {
41
- ArrayList <Account > expected = accounts ;
42
- ArrayList <Account > actual = atm .getAccounts ();
42
+ ArrayList <ATM . Account > expected = accounts ;
43
+ ArrayList <ATM . Account > actual = atm .getAccounts ();
43
44
Assert .assertEquals (expected , actual );
44
45
}
45
46
@@ -54,20 +55,20 @@ public void displayAccountNamesAndBalancesTest() {
54
55
55
56
@ Test
56
57
public void addAccountToAccountsTest () {
57
- Account expected = new SavingsAccount (BankAccountType .SAVINGS , 0.0 , "John" , 0.0 ,
58
+ ATM . Account expected = new SavingsAccount (BankAccountType .SAVINGS , 0.0 , "John" , 0.0 ,
58
59
BankAccountStatus .OPEN , OverdraftProtection .ENABLED );
59
60
atm .addAccountToAccounts (expected );
60
- Account actual = atm .getAccounts ().get (3 );
61
+ ATM . Account actual = atm .getAccounts ().get (3 );
61
62
Assert .assertEquals (expected , actual );
62
63
}
63
64
64
65
@ Test
65
66
public void removeAccountWithNameAndBalanceTest () {
66
67
// need to implement .equals in Account I believe
67
- ArrayList <Account > expected = accounts ;
68
+ ArrayList <ATM . Account > expected = accounts ;
68
69
69
70
atm .removeAccountWithNameAndBalance ("John" , 0.0 );
70
71
71
- ArrayList <Account > actual = atm .getAccounts ();
72
+ ArrayList <ATM . Account > actual = atm .getAccounts ();
72
73
}
73
74
}
0 commit comments