Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. const assert = require('assert');
  2.  
  3. // ... mon code ...
  4.  
  5. class BankCustomer {
  6. constructor(name, key) {
  7. let customer = name;
  8. let pinCode = key;
  9.  
  10. this.getName = () => customer;
  11.  
  12. this.verifyPinInput = (input) => {
  13. if (input === pinCode) {
  14. return true;
  15. } else {
  16. return false;
  17. }
  18. }
  19. }
  20. }
  21.  
  22. // Tests
  23. const customer = new BankCustomer('John Doe', '3579');
  24. assert.equal(typeof customer.getName, 'function');
  25. assert.equal(typeof customer.verifyPinInput, 'function');
  26. assert.equal(customer.getName(), 'John Doe');
  27. assert.ok(customer.verifyPinInput('3579'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement