SHARE
TWEET

Untitled

a guest Mar 24th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const assert = require('assert');
  2.  
  3. // ... Ton code ici ...
  4.  
  5. class BankCustomer {
  6.   constructor(nameClient, secretCode){
  7.     let client = nameClient;
  8.     let code = secretCode;
  9.  
  10.     this.verifyPinInput = (codeTentative) => {
  11.       if (code === codeTentative){
  12.         return true;
  13.       } else {
  14.         return false;
  15.       }
  16.     }
  17.     this.getName = () => {
  18.       return client;
  19.     }      
  20.   }
  21. };
  22.  
  23.  
  24. // Tests
  25. const customer = new BankCustomer('John Doe', '3579');
  26. assert.equal(typeof customer.getName, 'function');
  27. assert.equal(typeof customer.verifyPinInput, 'function');
  28. assert.equal(customer.getName(), 'John Doe');
  29. assert.ok(customer.verifyPinInput('3579'));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top