Skip to content

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

Conversation

RMillerCohort251
Copy link
Contributor

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.


import java.util.UUID;

public class MoneyOrder extends Check {
Copy link
Contributor

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();
Copy link
Contributor

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
Copy link
Contributor

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);
Copy link
Contributor

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) {
Copy link
Contributor

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.

@anthonydmays
Copy link
Contributor

Your pull request names are STILL not following convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants