Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import * as assert from 'assert';
  2.  
  3. class BankCustomer {
  4. private name: string;
  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(pin: string): boolean {
  17. return (pin === this.pin ? true : false);
  18. }
  19. }
  20.  
  21.  
  22.  
  23. // Tests
  24.  
  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