Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import assert from 'assert';
- // ... Ton code ici ...
- class BankCustomer {
- private _name: string;
- private _code: number;
- constructor(name: string, code: number) {
- this._name = name;
- this._code = code;
- }
- getName(): string {
- return this._name;
- }
- verifyPinInput(newCode): boolean {
- if (newCode === this._code) {
- return newCode = true;
- } else {
- return newCode = 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'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement