Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. const assert = require('assert');
  2.  
  3. // ... Ton code ici ...
  4. class BankCustomer{
  5. constructor(name, pin){
  6. const customerName = name;
  7. const inputPin = pin;
  8. this.getName = () => customerName;
  9. this.verifyPinInput = () =>{
  10. if (inputPin) {
  11. return true;
  12. } else {
  13. return false;
  14. }
  15. }
  16. }}
  17. // Tests
  18. const customer = new BankCustomer('John Doe', '3579');
  19. assert.equal(typeof customer.getName, 'function');
  20. assert.equal(typeof customer.verifyPinInput, 'function');
  21. assert.equal(customer.getName(), 'John Doe');
  22. assert.ok(customer.verifyPinInput('3579'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement