daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const assert = require('assert');
  2.  
  3. class BankCustomer {
  4.     constructor (name, code) {
  5.         var enteredPin = '3579';
  6.         this.name = name;
  7.         this.code = code;
  8.         this.getPin = () => enteredPin;
  9.     }
  10.  
  11.     getName() {return `${this.name}`;}
  12.     verifyPinInput() {
  13.         if (this.code === this.getPin()) {return true;
  14.         } else {return false;
  15.         }        
  16.     }
  17. }
  18.  
  19. // Tests
  20. const customer = new BankCustomer('John Doe', '3579');
  21. assert.equal(typeof customer.getName, 'function');
  22. assert.equal(typeof customer.verifyPinInput, 'function');
  23. assert.equal(customer.getName(), 'John Doe');
  24. 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