Created
December 20, 2019 16:21
-
-
Save ROgbonna1/0da6e0f1f6f6ffcf6fb519b2e8ab029f to your computer and use it in GitHub Desktop.
Copy and paste this over the question 2 unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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