-
Notifications
You must be signed in to change notification settings - Fork 24
feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator #537
Conversation
|
||
import java.util.UUID; | ||
|
||
public class MoneyOrder extends Check { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A money order is not a check.
|
||
@BeforeEach | ||
void setUp() { | ||
classUnderTest = new BankAtm(); | ||
new BankAtm(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
@@ -58,10 +62,8 @@ void testFindAccountsByCustomerId() { | |||
|
|||
@Test | |||
void testDepositFunds() { | |||
// Act |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
|
||
MoneyOrder moneyOrder = new MoneyOrder(sourceAccount, amount); | ||
|
||
assertEquals(initialBalance - amount, sourceAccount.getBalance(), 0.001); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is difficult to read. Would've been better like this:
// Arrange
var sourceAccount = new CheckingAccount("TRG456", Set.of(bob), 1000.0);
// Act
var moneyOrder = new MoneyOrder(sourceAccount, 250);
// Assert
assertEquals(750.0, sourceAccount.getBalance(), 0.001);
Remember that we prefer our tests to be DAMP, not DRY.
AuditLog.getInstance().log("CHECK DEPOSIT", account.getAccountNumber(), check.getAmount()); | ||
} | ||
|
||
public void depositFunds(String accountNumber, MoneyOrder mo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were not to add any new methods.
Your pull request names are STILL not following convention. |
Created a MoneyOrder class that integrates with the BankAtm class. Created an AuditLog class that keeps a record of all debits and credits to any account and integrate it with the BankAtm class.