Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. const assert = require('assert');
  2.  
  3. class BankCustomer {
  4. constructor(name, code) {
  5. this.name = name;
  6. const codePin = code;
  7.  
  8. this.verifyPinInput = function(input) {
  9. return codePin === input;
  10. }
  11. }
  12.  
  13. getName() {
  14. return this.name;
  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'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement