Created
March 18, 2019 16:36
-
-
Save mehdihettak/79a325f6b3fffcdf137c4a70c7c61261 to your computer and use it in GitHub Desktop.
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
| const assert = require('assert'); | |
| // ... Ton code ici ... | |
| class BankCustomer { | |
| constructor(name, code) { | |
| let codeSecret = code; | |
| let nameSecret = name; | |
| this.getName = () => nom; | |
| this.verifyInput = () => { | |
| if (code === codeSecret) { | |
| return true; | |
| } | |
| else { | |
| return false; | |
| } | |
| } | |
| } | |
| } | |
| // Tests | |
| const customer = new BankCustomer('John Doe', '3579'); | |
| assert.equal(typeof customer.getName, 'function'); | |
| assert.equal(typeof customer.verifyPinInput, 'function'); | |
| assert.equal(customer.getName(), 'John Doe'); | |
| assert.ok(customer.verifyPinInput('3579')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment