Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. const assert = require('assert')
  2.  
  3.  
  4. // ... Ton code ici ...
  5.  
  6. class BankCustomer {
  7. private name : string
  8. private secretCode : string
  9.  
  10. constructor(name : string, secretCode : string) {
  11. this.name = name,
  12. this.secretCode = secretCode
  13. }
  14.  
  15. getName () {return this.name}
  16.  
  17. verifyPinInput (code : string) {if (code === this.secretCode) {return true} else {return false}}
  18. }
  19.  
  20.  
  21. // Tests
  22.  
  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