Skip to content

Instantly share code, notes, and snippets.

View ROgbonna1's full-sized avatar

Reuben Ogbonna ROgbonna1

View GitHub Profile
@ROgbonna1
ROgbonna1 / question2.test.js
Created December 20, 2019 16:21
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');