SHARE
TWEET

Untitled

a guest Apr 18th, 2019 56 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. class BankCustomer{
  5.     constructor (name,pin){
  6.         let firstName = name;
  7.         let code = pin;
  8.        this.getName = () => {return firstName };
  9.        
  10.        this.verifyPinInput = (input) => {
  11.            if (code === input){
  12.             return true;
  13.         }else{
  14.             return false;
  15.         }
  16.     }
  17.     };
  18. };
  19.  
  20.  
  21. // Tests
  22. const customer = new BankCustomer('John Doe', '3579');
  23. assert.equal(typeof customer.getName, 'function');
  24. assert.equal(typeof customer.verifyPinInput, 'function');
  25. assert.equal(customer.getName(), 'John Doe');
  26. assert.ok(customer.verifyPinInput('3579'));
  27.  
  28. console.log(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