-
Notifications
You must be signed in to change notification settings - Fork 0
/
myAccountTest.java
60 lines (43 loc) · 1.52 KB
/
myAccountTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package eBank;
import AccountDemo.Account;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
public class myAccountTest {
@Test
public void accountCanBeCreatedTest() {
Account account = new Account("2334", "tobi", "kole", "2222");
assertNotNull(account);
}
@Test
public void accountNumberCanBeCreatedWithAllDetailsTest() {
Account account = new Account("2334", "tobi", "kole", "2222");
assertEquals("2334", account.getaccountNumber());
assertEquals("tobi kole", account.getaccountName());
}
@Test
public void accountDepositTest() {
Account account = new Account("2234", "tobi", "kole", "2222");
account.deposit(500);
assertEquals(500, account.getAccountBalance("2222"));
}
@Test
public void accountDepositTestFor2() {
Account account = new Account("2234", "tobi", "kole", "2222");
account.deposit(500);
account.deposit(400);
assertEquals(900, account.getAccountBalance("2222"));
}
@Test
public void wrongpin() {
Account account = new Account("2234", "tobi", "kole", "2222");
account.deposit(5000);
assertEquals(0, account.getAccountBalance("2322"));
// @Test
// public void withDraw(){
// Account account = new Account("2234", "tobi", "kole", 2222);
// account.withDraw(600);
// assertEquals(0, account.getAccountBalance(2322));
// }
}
}