SHARE
TWEET

Untitled

a guest Oct 18th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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'));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top