Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ... Ton code ici ...
- import * as assert from 'assert';
- class BankCustomer{
- private name: string;
- private codeCreditCard: string;
- constructor(name: string, codeCreditCard: string) {
- this.name = name;
- this.codeCreditCard = codeCreditCard;
- }
- // Tests
- getName(){
- return this.name
- }
- verifyPinInput(x): boolean{
- if(x === this.codeCreditCard){
- return true;
- }
- else{
- return false;
- }
- }
- }
- const customer = new BankCustomer('John Doe', '3579');
- assert.equal(typeof customer.getName, 'function');
- assert.equal(typeof customer.verifyPinInput, 'function');
- assert.equal(customer.getName(), 'John Doe');
- assert.ok(customer.verifyPinInput('3579'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement