Skip to content

Instantly share code, notes, and snippets.

@ROgbonna1
Created December 20, 2019 16:21
Show Gist options
  • Select an option

  • Save ROgbonna1/0da6e0f1f6f6ffcf6fb519b2e8ab029f to your computer and use it in GitHub Desktop.

Select an option

Save ROgbonna1/0da6e0f1f6f6ffcf6fb519b2e8ab029f to your computer and use it in GitHub Desktop.
Copy and paste this over the question 2 unit tests
test('Question 2', () => {
const myAccount = new solutions.SavingsAccount('Reuben');
expect(myAccount.name).toBe('Reuben');
expect(myAccount.showBalance()).toBe('$0');
expect(myAccount.depositFunds(100)).toBe('$100 Deposited');
expect(myAccount.showBalance()).toBe('$100');
expect(myAccount.depositFunds(-100)).toBe('Please include a deposit amount that is greater than 0');
expect(myAccount.showBalance()).toBe('$100');
expect(myAccount.withdrawFunds(75)).toBe('$75 withdrawn');
expect(myAccount.showBalance()).toBe('$25');
expect(myAccount.withdrawFunds(26)).toBe('Insufficient Funds');
expect(myAccount.showBalance()).toBe('$25');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment