Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const assert = require('assert');
- // ... Ton code ici ...
- class BankCustomer{
- constructor(nameClient, codeSecret){
- let verifCode = codeSecret;
- let clientNom = nameClient;
- this.getName = () => {
- return clientNom;
- }
- this.verifyPinInput = (codeSecretEntrer) => {
- if (codeSecretEntrer === verifCode){
- 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'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement