Advertisement
Guest User

Untitled

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