Skip to content

Instantly share code, notes, and snippets.

@Lexhoo
Created May 20, 2020 13:46
Show Gist options
  • Save Lexhoo/38edfc5c522df6bb60c7481c36c42a5a to your computer and use it in GitHub Desktop.
Save Lexhoo/38edfc5c522df6bb60c7481c36c42a5a to your computer and use it in GitHub Desktop.
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