Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import * as assert from 'assert';
  2.  
  3.  
  4. // ... Ton code ici ...
  5.  
  6. class BankCustomer {
  7. private name : string;
  8. private code : string;
  9.  
  10. constructor(name:string, code : string){
  11. this.name = name;
  12. this.code = code;
  13. }
  14.  
  15. getName(){
  16. return this.name;
  17. }
  18.  
  19. verifyPinInput(i:string):boolean{
  20. if ( i === this.code){
  21. return true;
  22. }
  23. else{
  24. return false;
  25. }
  26. }
  27.  
  28. }
  29.  
  30. // Tests
  31.  
  32. const customer = new BankCustomer('John Doe', '3579');
  33. assert.equal(typeof customer.getName, 'function');
  34. assert.equal(typeof customer.verifyPinInput, 'function');
  35. assert.equal(customer.getName(), 'John Doe');
  36. assert.ok(customer.verifyPinInput('3579'));
  37.  
  38. console.log(customer.verifyPinInput('3579'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement