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.74 KB | None | 0 0
  1. // ... Ton code ici ...
  2. import * as assert from 'assert';
  3.  
  4. class BankCustomer{
  5. private name: string;
  6. private codeCreditCard: string;
  7.  
  8. constructor(name: string, codeCreditCard: string) {
  9. this.name = name;
  10. this.codeCreditCard = codeCreditCard;
  11. }
  12. // Tests
  13. getName(){
  14. return this.name
  15. }
  16. verifyPinInput(x): boolean{
  17. if(x === this.codeCreditCard){
  18. return true;
  19. }
  20. else{
  21. return false;
  22. }
  23. }
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. const customer = new BankCustomer('John Doe', '3579');
  32. assert.equal(typeof customer.getName, 'function');
  33. assert.equal(typeof customer.verifyPinInput, 'function');
  34. assert.equal(customer.getName(), 'John Doe');
  35. assert.ok(customer.verifyPinInput('3579'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement