Skip to content

Commit bd2aab0

Browse files
author
AmiyahJo
committed
fix: boolean parameter for customers
1 parent e55cbe2 commit bd2aab0

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

lesson_17/bank/bank_app/src/test/java/com/codedifferently/lesson17/bank/BankAtmTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class BankAtmTest {
2222
@BeforeEach
2323
void setUp() {
2424
classUnderTest = new BankAtm();
25-
customer1 = new Customer(UUID.randomUUID(), "John Doe");
26-
customer2 = new Customer(UUID.randomUUID(), "Jane Smith");
25+
customer1 = new Customer(UUID.randomUUID(), "John Doe", true);
26+
customer2 = new Customer(UUID.randomUUID(), "Jane Smith", true);
2727
account1 = new CheckingAccount("123456789", Set.of(customer1), 100.0);
2828
account2 = new CheckingAccount("987654321", Set.of(customer1, customer2), 200.0);
2929
customer1.addAccount(account1);
@@ -36,7 +36,7 @@ void setUp() {
3636
@Test
3737
void testAddAccount() {
3838
// Arrange
39-
Customer customer3 = new Customer(UUID.randomUUID(), "Alice Johnson");
39+
Customer customer3 = new Customer(UUID.randomUUID(), "Alice Johnson", true);
4040
CheckingAccount account3 = new CheckingAccount("555555555", Set.of(customer3), 300.0);
4141
customer3.addAccount(account3);
4242

@@ -112,7 +112,7 @@ void testWithdrawFunds_AccountNotFound() {
112112
@Test
113113
void testAddBusinessCheckingAccountWithoutBusinessAccount() {
114114
// Arrange
115-
Customer businessOwner = new Customer(UUID.randomUUID(), "Business Owner");
115+
Customer businessOwner = new Customer(UUID.randomUUID(), "Business Owner", true);
116116
Set<Customer> owners = Set.of(businessOwner);
117117
BusinessCheckingAccount businessAccount = new BusinessCheckingAccount("123456789", owners, "Business Inc.", 1000.0);
118118

@@ -125,7 +125,7 @@ void testAddBusinessCheckingAccountWithoutBusinessAccount() {
125125
@Test
126126
void testGetBusinessName() {
127127
// Arrange
128-
Customer businessOwner = new Customer(UUID.randomUUID(), "Business Owner");
128+
Customer businessOwner = new Customer(UUID.randomUUID(), "Business Owner", true);
129129
Set<Customer> owners = Set.of(businessOwner);
130130
BusinessCheckingAccount businessAccount = new BusinessCheckingAccount("123456789", owners, "Business Inc.", 1000.0);
131131

lesson_17/bank/bank_app/src/test/java/com/codedifferently/lesson17/bank/CheckingAccountTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package com.codedifferently.lesson17.bank;
22

3+
import java.util.HashSet;
4+
import java.util.Set;
5+
import java.util.UUID;
6+
37
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
48
import static org.junit.jupiter.api.Assertions.assertEquals;
59
import static org.junit.jupiter.api.Assertions.assertFalse;
610
import static org.junit.jupiter.api.Assertions.assertTrue;
7-
8-
import com.codedifferently.lesson17.bank.exceptions.InsufficientFundsException;
9-
import java.util.HashSet;
10-
import java.util.Set;
11-
import java.util.UUID;
1211
import org.junit.jupiter.api.BeforeEach;
1312
import org.junit.jupiter.api.Test;
1413

14+
import com.codedifferently.lesson17.bank.exceptions.InsufficientFundsException;
15+
1516
class CheckingAccountTest {
1617

1718
private CheckingAccount classUnderTest;
@@ -20,8 +21,8 @@ class CheckingAccountTest {
2021
@BeforeEach
2122
void setUp() {
2223
owners = new HashSet<>();
23-
owners.add(new Customer(UUID.randomUUID(), "John Doe"));
24-
owners.add(new Customer(UUID.randomUUID(), "Jane Smith"));
24+
owners.add(new Customer(UUID.randomUUID(), "John Doe", false));
25+
owners.add(new Customer(UUID.randomUUID(), "Jane Smith", false));
2526
classUnderTest = new CheckingAccount("123456789", owners, 100.0);
2627
}
2728

0 commit comments

Comments
 (0)