Advertisement
Guest User

Untitled

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