Skip to content

feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator#537

Closed
RMillerCohort251 wants to merge 1 commit intocode-differently:mainfrom
RMillerCohort251:feat-RMiller_lesson_17_homework1
Closed

feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator#537
RMillerCohort251 wants to merge 1 commit intocode-differently:mainfrom
RMillerCohort251:feat-RMiller_lesson_17_homework1

Conversation

@RMillerCohort251
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?


@Test
void testDepositFunds() {
// Act
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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