Created
May 20, 2020 13:46
-
-
Save Lexhoo/38edfc5c522df6bb60c7481c36c42a5a to your computer and use it in GitHub Desktop.
This file contains 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
import assert from 'assert'; | |
class BankCustomer { | |
private name: string; | |
private secretCode: string; | |
public isCodeOk: boolean = false; | |
constructor(name: string, code: string) { | |
this.name = name; | |
this.secretCode = code; | |
} | |
getName() { | |
return this.name; | |
} | |
verifyPinInput(codeEntre: string) { | |
if(this.secretCode === codeEntre) { | |
this.isCodeOk = true; | |
} | |
return this.isCodeOk; | |
} | |
} | |
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')); | |
console.log(customer); | |
export default assert; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment