Advertisement
Guest User

Untitled

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